mirror of
git://source.winehq.org/git/wine.git
synced 2024-11-05 18:01:34 +00:00
winemac: Add a category on NSEvent to simplify checking if the Command key (and only that modifier) is pressed for an event.
Signed-off-by: Ken Thomases <ken@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
04317b5571
commit
af2690ab06
3 changed files with 27 additions and 1 deletions
|
@ -1653,7 +1653,7 @@ - (void) handleMouseButton:(NSEvent*)theEvent
|
|||
|
||||
if ([window isKindOfClass:[WineWindow class]] &&
|
||||
type == NSLeftMouseDown &&
|
||||
(([theEvent modifierFlags] & (NSShiftKeyMask | NSControlKeyMask| NSAlternateKeyMask | NSCommandKeyMask)) != NSCommandKeyMask))
|
||||
![theEvent wine_commandKeyDown])
|
||||
{
|
||||
NSWindowButton windowButton;
|
||||
|
||||
|
|
|
@ -28,6 +28,12 @@
|
|||
};
|
||||
|
||||
|
||||
@interface NSEvent (WineExtensions)
|
||||
+ (BOOL) wine_commandKeyDown;
|
||||
- (BOOL) wine_commandKeyDown;
|
||||
@end
|
||||
|
||||
|
||||
@class WineWindow;
|
||||
|
||||
|
||||
|
|
|
@ -40,6 +40,26 @@
|
|||
static const OSType WineHotKeySignature = 'Wine';
|
||||
|
||||
|
||||
@implementation NSEvent (WineExtensions)
|
||||
|
||||
static BOOL wine_commandKeyDown(NSUInteger flags)
|
||||
{
|
||||
return ((flags & (NSShiftKeyMask | NSControlKeyMask | NSAlternateKeyMask | NSCommandKeyMask)) == NSCommandKeyMask);
|
||||
}
|
||||
|
||||
+ (BOOL) wine_commandKeyDown
|
||||
{
|
||||
return wine_commandKeyDown([self modifierFlags]);
|
||||
}
|
||||
|
||||
- (BOOL) wine_commandKeyDown
|
||||
{
|
||||
return wine_commandKeyDown([self modifierFlags]);
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
|
||||
@interface MacDrvEvent : NSObject
|
||||
{
|
||||
@public
|
||||
|
|
Loading…
Reference in a new issue