mirror of
https://github.com/nickshanks/ResKnife.git
synced 2024-12-22 17:30:15 +00:00
25 lines
420 B
Objective-C
25 lines
420 B
Objective-C
#import "NSEvent-ModifierKeys.h"
|
|
|
|
@implementation NSEvent (ModifierKeys)
|
|
|
|
+ (BOOL) isControlKeyDown
|
|
{
|
|
return (GetCurrentKeyModifiers() & controlKey) != 0;
|
|
}
|
|
|
|
+ (BOOL) isOptionKeyDown
|
|
{
|
|
return (GetCurrentKeyModifiers() & optionKey) != 0;
|
|
}
|
|
|
|
+ (BOOL) isCommandKeyDown
|
|
{
|
|
return (GetCurrentKeyModifiers() & cmdKey) != 0;
|
|
}
|
|
|
|
+ (BOOL) isShiftKeyDown
|
|
{
|
|
return (GetCurrentKeyModifiers() & shiftKey) != 0;
|
|
}
|
|
|
|
@end |