Source

BWToolkit / NSEvent+BWAdditions.m

Brandon Walkin 19a97e7 











Brandon Walkin 100e138 
Brandon Walkin 19a97e7 






Brandon Walkin 100e138 
Brandon Walkin 19a97e7 






Brandon Walkin 100e138 
Brandon Walkin 19a97e7 






Brandon Walkin 100e138 
Brandon Walkin 19a97e7 






Brandon Walkin 100e138 
Brandon Walkin 19a97e7 






//
//  NSEvent+BWAdditions.m
//  BWToolkit
//
//  Created by Brandon Walkin (www.brandonwalkin.com)
//  All code is provided under the New BSD license.
//

#import "NSEvent+BWAdditions.h"

@implementation NSEvent (BWAdditions)

+ (BOOL)bwShiftKeyIsDown
{
	if ([[NSApp currentEvent] modifierFlags] & NSShiftKeyMask)
		return YES;
	
	return NO;
}

+ (BOOL)bwCommandKeyIsDown
{
	if ([[NSApp currentEvent] modifierFlags] & NSCommandKeyMask)
		return YES;
	
	return NO;
}

+ (BOOL)bwOptionKeyIsDown
{
	if ([[NSApp currentEvent] modifierFlags] & NSAlternateKeyMask)
		return YES;
	
	return NO;
}

+ (BOOL)bwControlKeyIsDown
{
	if ([[NSApp currentEvent] modifierFlags] & NSControlKeyMask)
		return YES;
	
	return NO;
}

+ (BOOL)bwCapsLockKeyIsDown
{
	if ([[NSApp currentEvent] modifierFlags] & NSAlphaShiftKeyMask)
		return YES;
	
	return NO;
}

@end