Skip to content

Instantly share code, notes, and snippets.

@moyashi
Created September 26, 2011 15:16
Show Gist options
  • Save moyashi/1242475 to your computer and use it in GitHub Desktop.
Save moyashi/1242475 to your computer and use it in GitHub Desktop.
GSEventType eventType = GSEventGetType((GSEventRef)event);
GSEventFlags modFlag = GSEventGetModifierFlags((GSEventRef)event);
UniChar keyCode = GSEventGetKeyCode((GSEventRef)event);
NSLog(@"----------event: %d", eventType);
NSLog(@"----------modifier: %d", modFlag);
NSLog(@"----------keycode: %d", keyCode);
uint fCTRL = (modFlag & 1048576) ? YES : NO;
uint fSHIFT = (modFlag & 131072) ? YES : NO;
uint fALT = (modFlag & 524288) ? YES : NO;
uint fCMD = (modFlag & 65536) ? YES : NO;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment