mirror of
https://github.com/libretro/scummvm.git
synced 2024-12-14 05:38:56 +00:00
IOS: Fix Arrow Key Capture in TextInputHandler.
This should fix these working from external keyboards i.e. IPad Pro and other sources as well. This is presumably what the original author intended.
This commit is contained in:
parent
4865b02e39
commit
82e8bc43e6
@ -53,6 +53,30 @@
|
||||
return self;
|
||||
}
|
||||
|
||||
- (NSArray *)keyCommands {
|
||||
UIKeyCommand *upArrow = [UIKeyCommand keyCommandWithInput: UIKeyInputUpArrow modifierFlags: 0 action: @selector(upArrow:)];
|
||||
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];
|
||||
}
|
||||
|
||||
- (void) upArrow: (UIKeyCommand *) keyCommand {
|
||||
[softKeyboard handleKeyPress:273];
|
||||
}
|
||||
|
||||
- (void) downArrow: (UIKeyCommand *) keyCommand {
|
||||
[softKeyboard handleKeyPress:274];
|
||||
}
|
||||
|
||||
- (void) leftArrow: (UIKeyCommand *) keyCommand {
|
||||
[softKeyboard handleKeyPress:276];
|
||||
}
|
||||
|
||||
- (void) rightArrow: (UIKeyCommand *) keyCommand {
|
||||
[softKeyboard handleKeyPress:275];
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
|
||||
@ -66,30 +90,6 @@
|
||||
return self;
|
||||
}
|
||||
|
||||
- (NSArray *)keyCommands {
|
||||
UIKeyCommand *upArrow = [UIKeyCommand keyCommandWithInput: UIKeyInputUpArrow modifierFlags: 0 action: @selector(upArrow:)];
|
||||
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];
|
||||
}
|
||||
|
||||
- (void) upArrow: (UIKeyCommand *) keyCommand {
|
||||
[self handleKeyPress:273];
|
||||
}
|
||||
|
||||
- (void) downArrow: (UIKeyCommand *) keyCommand {
|
||||
[self handleKeyPress:274];
|
||||
}
|
||||
|
||||
- (void) leftArrow: (UIKeyCommand *) keyCommand {
|
||||
[self handleKeyPress:276];
|
||||
}
|
||||
|
||||
- (void) rightArrow: (UIKeyCommand *) keyCommand {
|
||||
[self handleKeyPress:275];
|
||||
}
|
||||
|
||||
- (BOOL)textView:(UITextView *)textView shouldChangeTextInRange:(NSRange)range replacementText:(NSString *)text {
|
||||
unichar c;
|
||||
if (text.length) {
|
||||
|
Loading…
Reference in New Issue
Block a user