Commit af2690ab authored by Ken Thomases's avatar Ken Thomases Committed by Alexandre Julliard

winemac: Add a category on NSEvent to simplify checking if the Command key (and…

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: 's avatarKen Thomases <ken@codeweavers.com> Signed-off-by: 's avatarAlexandre Julliard <julliard@winehq.org>
parent 04317b55
......@@ -1653,7 +1653,7 @@ static NSString* WineLocalizedString(unsigned int stringID)
if ([window isKindOfClass:[WineWindow class]] &&
type == NSLeftMouseDown &&
(([theEvent modifierFlags] & (NSShiftKeyMask | NSControlKeyMask| NSAlternateKeyMask | NSCommandKeyMask)) != NSCommandKeyMask))
![theEvent wine_commandKeyDown])
{
NSWindowButton windowButton;
......
......@@ -28,6 +28,12 @@ enum {
};
@interface NSEvent (WineExtensions)
+ (BOOL) wine_commandKeyDown;
- (BOOL) wine_commandKeyDown;
@end
@class WineWindow;
......
......@@ -40,6 +40,26 @@ static NSString* const WineHotKeyCarbonRefKey = @"hotKeyRef";
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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment