aboutsummaryrefslogtreecommitdiff
path: root/backends/platform
diff options
context:
space:
mode:
authorMichael Zinn2018-08-16 19:20:21 +0200
committerD G Turner2018-08-23 23:42:52 +0100
commit82e8bc43e60ce5908097d62be1b2fbb59c4679e8 (patch)
tree916812954088dde04875471a5cc254a96fc16d47 /backends/platform
parent4865b02e3937d166108d505ebf1370b205f34b29 (diff)
downloadscummvm-rg350-82e8bc43e60ce5908097d62be1b2fbb59c4679e8.tar.gz
scummvm-rg350-82e8bc43e60ce5908097d62be1b2fbb59c4679e8.tar.bz2
scummvm-rg350-82e8bc43e60ce5908097d62be1b2fbb59c4679e8.zip
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.
Diffstat (limited to 'backends/platform')
-rw-r--r--backends/platform/ios7/ios7_keyboard.mm34
1 files changed, 17 insertions, 17 deletions
diff --git a/backends/platform/ios7/ios7_keyboard.mm b/backends/platform/ios7/ios7_keyboard.mm
index 98696d9497..ff084a1a9e 100644
--- a/backends/platform/ios7/ios7_keyboard.mm
+++ b/backends/platform/ios7/ios7_keyboard.mm
@@ -53,19 +53,6 @@
return self;
}
-@end
-
-
-@implementation SoftKeyboard
-
-- (id)initWithFrame:(CGRect)frame {
- self = [super initWithFrame:frame];
- inputDelegate = nil;
- inputView = [[TextInputHandler alloc] initWithKeyboard:self];
- inputView.delegate = self;
- return self;
-}
-
- (NSArray *)keyCommands {
UIKeyCommand *upArrow = [UIKeyCommand keyCommandWithInput: UIKeyInputUpArrow modifierFlags: 0 action: @selector(upArrow:)];
UIKeyCommand *downArrow = [UIKeyCommand keyCommandWithInput: UIKeyInputDownArrow modifierFlags: 0 action: @selector(downArrow:)];
@@ -75,19 +62,32 @@
}
- (void) upArrow: (UIKeyCommand *) keyCommand {
- [self handleKeyPress:273];
+ [softKeyboard handleKeyPress:273];
}
- (void) downArrow: (UIKeyCommand *) keyCommand {
- [self handleKeyPress:274];
+ [softKeyboard handleKeyPress:274];
}
- (void) leftArrow: (UIKeyCommand *) keyCommand {
- [self handleKeyPress:276];
+ [softKeyboard handleKeyPress:276];
}
- (void) rightArrow: (UIKeyCommand *) keyCommand {
- [self handleKeyPress:275];
+ [softKeyboard handleKeyPress:275];
+}
+
+@end
+
+
+@implementation SoftKeyboard
+
+- (id)initWithFrame:(CGRect)frame {
+ self = [super initWithFrame:frame];
+ inputDelegate = nil;
+ inputView = [[TextInputHandler alloc] initWithKeyboard:self];
+ inputView.delegate = self;
+ return self;
}
- (BOOL)textView:(UITextView *)textView shouldChangeTextInRange:(NSRange)range replacementText:(NSString *)text {