Hi,
First I tried - (void)keyDown:(NSEvent *) in a subclass of NSView, all other keys works but now arrow keys.
I also tried addLocalMonitorForEventsMatchingMask, I can success captured arrow keys, but system warning with 'funk' sound when I press arrow key.
[NSEvent addLocalMonitorForEventsMatchingMask:NSEventMaskKeyDown
handler:^NSEvent * _Nullable(NSEvent * event) {
//check if it is arrow key
return event;
}];
- (BOOL)performKeyEquivalent:(NSEvent *)event {
return YES;
}
I'm not able to find a answer from https://developer.apple.com/library/archive/documentation/Cocoa/Conceptual/EventOverview/HandlingKeyEvents/HandlingKeyEvents.html