Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
iOS 7 UIKeyCommand keydown/keyup and keycode input implementation for a UIResponder. Private API, of course…
-(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