I have a NSView subclass and I would like it to react when the user presses the ⇧ Shift key. However, -[NSView keyDown:] (which I curren
Checking for pressed:
-(void)keyDown:(NSEvent *)theEvent
{
if ([theEvent modifierFlags] & NSShiftKeyMask)
{
NSLog("Shift key was pressed");
}
}
Checking for release:
-(void)keyUp:(NSEvent *)theEvent
{
if(!([theEvent modifierFlags] & NSShiftKeyMask))
{
NSLog("Shift key was released");
}
}
It should be noted, the NSLog function will only be called if SHIFT and then some other key is pressed.
Hope this helps!