diff options
author | D G Turner | 2018-06-24 02:45:37 +0100 |
---|---|---|
committer | Eugene Sandulenko | 2018-07-25 10:17:40 +0200 |
commit | eee970df1fa75ede7130a8d69b04cbc573512f9b (patch) | |
tree | aa3cc93217602e2759ce8ef5f549bf3ffc8ebbc1 /backends/platform/ios7/ios7_keyboard.mm | |
parent | 75587c3c669d371601a9c508aad27191e9a9aacd (diff) | |
download | scummvm-rg350-eee970df1fa75ede7130a8d69b04cbc573512f9b.tar.gz scummvm-rg350-eee970df1fa75ede7130a8d69b04cbc573512f9b.tar.bz2 scummvm-rg350-eee970df1fa75ede7130a8d69b04cbc573512f9b.zip |
IOS: Add Keyboard and UI Fixes for Smartkeyboard on IPad Pro.
These have not been compiled or otherwise tested, but are cleaned up
version of code changes from forum user "dottostring" in thread:
http://forums.scummvm.org/viewtopic.php?t=14524
This should add Fake ESC key support replacing the '`' key and add full
support for the Arrow keys.
Diffstat (limited to 'backends/platform/ios7/ios7_keyboard.mm')
-rw-r--r-- | backends/platform/ios7/ios7_keyboard.mm | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/backends/platform/ios7/ios7_keyboard.mm b/backends/platform/ios7/ios7_keyboard.mm index 9476b96ad4..f6d1b59eaf 100644 --- a/backends/platform/ios7/ios7_keyboard.mm +++ b/backends/platform/ios7/ios7_keyboard.mm @@ -46,6 +46,9 @@ [self setAutocorrectionType:UITextAutocorrectionTypeNo]; [self setAutocapitalizationType:UITextAutocapitalizationTypeNone]; [self setEnablesReturnKeyAutomatically:NO]; + UITextInputAssistantItem* item = [self inputAssistantItem]; + item.leadingBarButtonGroups = @[]; + item.trailingBarButtonGroups = @[]; return self; } @@ -63,6 +66,31 @@ 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 resignFirstResponder]; + [softKeyboard handleKeyPress:273]; +} + +- (void) downArrow: (UIKeyCommand *) keyCommand { + [softKeyboard handleKeyPress:274]; +} + +- (void) leftArrow: (UIKeyCommand *) keyCommand { + [softKeyboard handleKeyPress:276]; +} + +- (void) rightArrow: (UIKeyCommand *) keyCommand { + [softKeyboard handleKeyPress:275]; +} + - (BOOL)textView:(UITextView *)textView shouldChangeTextInRange:(NSRange)range replacementText:(NSString *)text { unichar c; if (text.length) { |