IOS7: Support using Escape key on external keyboards

This commit is contained in:
Thierry Crozat 2021-09-23 00:11:34 +01:00
parent dbce998d04
commit 2435046146

View File

@ -151,7 +151,8 @@
UIKeyCommand *downArrow = [UIKeyCommand keyCommandWithInput: UIKeyInputDownArrow modifierFlags: 0 action: @selector(downArrow:)];
UIKeyCommand *leftArrow = [UIKeyCommand keyCommandWithInput: UIKeyInputLeftArrow modifierFlags: 0 action: @selector(leftArrow:)];
UIKeyCommand *rightArrow = [UIKeyCommand keyCommandWithInput: UIKeyInputRightArrow modifierFlags: 0 action: @selector(rightArrow:)];
return [[NSArray alloc] initWithObjects: upArrow, downArrow, leftArrow, rightArrow, nil];
UIKeyCommand *escapeKey = [UIKeyCommand keyCommandWithInput: UIKeyInputEscape modifierFlags: 0 action: @selector(escapeKey:)];
return [[NSArray alloc] initWithObjects: upArrow, downArrow, leftArrow, rightArrow, escapeKey, nil];
}
- (void) upArrow: (UIKeyCommand *) keyCommand {
@ -170,6 +171,10 @@
[softKeyboard handleKeyPress:Common::KEYCODE_RIGHT];
}
- (void) escapeKey: (UIKeyCommand *) keyCommand {
[softKeyboard handleKeyPress:Common::KEYCODE_ESCAPE];
}
- (void) mainMenuKey {
[softKeyboard handleMainMenuKey];
}