ResKnife/Cocoa/Categories/NSEvent-ModifierKeys.m
2002-04-27 18:17:47 +00:00

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