diff options
author | Oystein Eftevaag | 2009-03-01 08:41:03 +0000 |
---|---|---|
committer | Oystein Eftevaag | 2009-03-01 08:41:03 +0000 |
commit | 6ece2b10b8d5eb9243df69f740f39075b8e22a14 (patch) | |
tree | 53f9765149b11b10e2254acc18393afa21a34c75 | |
parent | ecb6b7bf54e66cc0ba0f4a79f4111abc42db08c2 (diff) | |
download | scummvm-rg350-6ece2b10b8d5eb9243df69f740f39075b8e22a14.tar.gz scummvm-rg350-6ece2b10b8d5eb9243df69f740f39075b8e22a14.tar.bz2 scummvm-rg350-6ece2b10b8d5eb9243df69f740f39075b8e22a14.zip |
Merged iphone keyboard fix in from branch-0-13-0
svn-id: r39020
-rw-r--r-- | backends/platform/iphone/iphone_keyboard.h | 8 | ||||
-rw-r--r-- | backends/platform/iphone/iphone_keyboard.m | 27 |
2 files changed, 25 insertions, 10 deletions
diff --git a/backends/platform/iphone/iphone_keyboard.h b/backends/platform/iphone/iphone_keyboard.h index 6d381d561d..5c17cc34b8 100644 --- a/backends/platform/iphone/iphone_keyboard.h +++ b/backends/platform/iphone/iphone_keyboard.h @@ -37,11 +37,3 @@ - (void)handleKeyPress:(unichar)c; @end - -@interface TextInputHandler : UITextView { - SoftKeyboard* softKeyboard; -} - -- (id)initWithKeyboard:(SoftKeyboard*)keyboard; - -@end diff --git a/backends/platform/iphone/iphone_keyboard.m b/backends/platform/iphone/iphone_keyboard.m index fda481933d..a5052ac077 100644 --- a/backends/platform/iphone/iphone_keyboard.m +++ b/backends/platform/iphone/iphone_keyboard.m @@ -25,15 +25,35 @@ #import "iphone_keyboard.h" +@interface UITextInputTraits +- (void)setAutocorrectionType:(int)type; +- (void)setAutocapitalizationType:(int)type; +- (void)setEnablesReturnKeyAutomatically:(BOOL)val; +@end + +@interface TextInputHandler : UITextView { + SoftKeyboard* softKeyboard; +} + +- (id)initWithKeyboard:(SoftKeyboard*)keyboard; + +@end + + @implementation TextInputHandler - (id)initWithKeyboard:(SoftKeyboard*)keyboard; { self = [super initWithFrame:CGRectMake(0.0f, 0.0f, 0.0f, 0.0f)]; softKeyboard = keyboard; + + [[self textInputTraits] setAutocorrectionType:1]; + [[self textInputTraits] setAutocapitalizationType:0]; + [[self textInputTraits] setEnablesReturnKeyAutomatically:NO]; + return self; } -- (BOOL)webView:(id)fp8 shouldDeleteDOMRange:(id)fp12 { +- (void) keyboardInputShouldDelete:(id)input { [softKeyboard handleKeyPress:0x08]; } @@ -43,9 +63,12 @@ if ([character length] != 1) { [NSException raise:@"Unsupported" format:@"Unhandled multi-char insert!"]; - return false; + return NO; } + [softKeyboard handleKeyPress:[character characterAtIndex:0]]; + + return NO; } @end |