Is there a way to differentiate between left and right Shift keys being pressed?
You can do it like this:
-(void)flagsChanged:(NSEvent *)theEvent {
if ([theEvent modifierFlags] == 131330) {
NSLog(@"Left shift pressed!");
}
if ([theEvent modifierFlags] == 131332) {
NSLog(@"Right shift pressed!");
}
}
In Swift:
let isLeftShift = event.modifierFlags.rawValue & UInt(NX_DEVICELSHIFTKEYMASK) != 0
let isRightShift = event.modifierFlags.rawValue & UInt(NX_DEVICERSHIFTKEYMASK) != 0