Last active
April 2, 2019 01:38
-
-
Save steventroughtonsmith/7515380 to your computer and use it in GitHub Desktop.
iOS 7 UIKeyCommand keydown/keyup and keycode input implementation for a UIResponder. Private API, of course…
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-(BOOL)canBecomeFirstResponder | |
{ | |
return YES; | |
} | |
-(UIKeyCommand *)_keyCommandForEvent:(UIEvent *)event // UIPhysicalKeyboardEvent | |
{ | |
NSLog(@"keyCommandForEvent: %@\n\ | |
type = %i\n\ | |
keycode = %@\n\ | |
keydown = %@\n\n", | |
event.debugDescription, | |
event.type, | |
[event valueForKey:@"_keyCode"], | |
[event valueForKey:@"_isKeyDown"]); | |
return [UIKeyCommand keyCommandWithInput:nil modifierFlags:nil action:@selector(processKeyInput:)]; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment