[Scummvm-cvs-logs] SF.net SVN: scummvm:[38879] scummvm/branches/branch-0-13-0/backends/ platform/iphone

vinterstum at users.sourceforge.net vinterstum at users.sourceforge.net
Wed Feb 25 18:53:44 CET 2009


Revision: 38879
          http://scummvm.svn.sourceforge.net/scummvm/?rev=38879&view=rev
Author:   vinterstum
Date:     2009-02-25 17:53:44 +0000 (Wed, 25 Feb 2009)

Log Message:
-----------
Fixed backspace handling on the iPhone soft keyboard

Modified Paths:
--------------
    scummvm/branches/branch-0-13-0/backends/platform/iphone/iphone_keyboard.h
    scummvm/branches/branch-0-13-0/backends/platform/iphone/iphone_keyboard.m

Modified: scummvm/branches/branch-0-13-0/backends/platform/iphone/iphone_keyboard.h
===================================================================
--- scummvm/branches/branch-0-13-0/backends/platform/iphone/iphone_keyboard.h	2009-02-25 17:36:38 UTC (rev 38878)
+++ scummvm/branches/branch-0-13-0/backends/platform/iphone/iphone_keyboard.h	2009-02-25 17:53:44 UTC (rev 38879)
@@ -37,11 +37,3 @@
 - (void)handleKeyPress:(unichar)c;
 
 @end
-
- at interface TextInputHandler : UITextView {
-	SoftKeyboard* softKeyboard;
-}
-
-- (id)initWithKeyboard:(SoftKeyboard*)keyboard;
-
- at end

Modified: scummvm/branches/branch-0-13-0/backends/platform/iphone/iphone_keyboard.m
===================================================================
--- scummvm/branches/branch-0-13-0/backends/platform/iphone/iphone_keyboard.m	2009-02-25 17:36:38 UTC (rev 38878)
+++ scummvm/branches/branch-0-13-0/backends/platform/iphone/iphone_keyboard.m	2009-02-25 17:53:44 UTC (rev 38879)
@@ -25,15 +25,35 @@
 
 #import "iphone_keyboard.h"
 
+ at interface UITextInputTraits
+- (void)setAutocorrectionType:(int)type;
+- (void)setAutocapitalizationType:(int)type;
+- (void)setEnablesReturnKeyAutomatically:(BOOL)val;
+ at end
+
+ at interface TextInputHandler : UITextView {
+	SoftKeyboard* softKeyboard;
+}
+
+- (id)initWithKeyboard:(SoftKeyboard*)keyboard;
+
+ at 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


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Scummvm-git-logs mailing list