Skip to content

Instantly share code, notes, and snippets.

@moyashi
Created September 26, 2011 15:16
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • 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