Guest User

Untitled

a guest
Jun 18th, 2018
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. - (void) startEventTap {
  2.    
  3.     NSLog(@"starting");
  4.     //eventTap is an ivar on this class of type CFMachPortRef
  5.     eventTap = CGEventTapCreate(kCGSessionEventTap, kCGHeadInsertEventTap, kCGEventTapOptionListenOnly, kCGEventMaskForAllEvents, myCGEventCallback, NULL);
  6.     CGEventTapEnable(eventTap, true);
  7. }
  8.  
  9. CGEventRef myCGEventCallback(CGEventTapProxy proxy, CGEventType type, CGEventRef event, void *refcon) {
  10.     NSLog(@"tap");
  11.    
  12.     return NULL;
  13.    
  14. }
Add Comment
Please, Sign In to add comment