Game Development Community

iT2D 1.4 Beta 2 - getIphoneKeyboardInput() not working - RESOLVED

by Shawn Simas · in iTorque 2D · 05/21/2010 (6:33 am) · 11 replies

Build: 1.4 Beta 2

Platform: iPhone 3.1.3

Issues: getIphoneKeyboardInput() not working. Throws two errors
1. gameInterface.cc @80 - Error! ProcessEvent is NOT reentrant.
2. tVector.h @435 - Vector<T>::operator[] - out of bounds array access!

Note, this works fine on simulator, issue is on device only.
I tested this on my 1stGen iPhone, and had another user test on his 2ndGen and both had the same error.

Steps to Repeat:
1: add %test = getIphoneKeyboardInput("test"); to your project
2: Run.



#1
05/21/2010 (7:17 am)
I can confirm I get exactly the same assert errors, with only the first line number differing (Xcode 3.2.2/Snow Leopard).
#2
05/25/2010 (12:57 am)
Noted and tasked, ITGB-48 :)
#3
06/01/2010 (10:45 am)
Ok, the new CADisplayLink is the cause, the runLoop changes make the entry back into processEvents.

Some notes here :
1) I never liked how the keyboard was implemented (it was blocking, and had issues)
2) No notification of when they hit cancel if at all, only a global variable.

I have re factored this and made it call a callback instead, making it asynchronous. The only consideration you might care for is to pause the game (don't know which games use text entry DURING game play but hey :))

The way to use it now is :
//First show the popup
getiPhoneKeyboardInput("defaultText");

//This gets called when the user dismisses the text entry screen
function oniPhoneKeyboardInputFinished(%result , %cancel)
{
	echo("user said " @ %result @ " and did they hit cancel? : " @ %cancel);
}

For now, if you need this fix specifically desperately, I can send you the files and fixes.
#4
06/01/2010 (10:52 am)
Very welcome change to the system.

iTGB is getting more and more in line with correct handling of async stuff and operating in the expected way for a mobile platform engine :)
#5
09/19/2010 (2:06 pm)
Hi Sven

I'm blocked by this issue and would really like to get the files and fixes, rather than having to upgrade to the new 1.4 release as I can't even get a project to build with it, and in any case I've made so many engine changes to my old version that upgrading would be a real hassle.

Could you please send them to sebgrinke@hotmail.com?

Thanks!

Seb Grinke
#6
09/19/2010 (2:09 pm)
I should probably add - my new project in the latest 1.4 release (downloaded today) fails to compile here in UIView.h:

@interface UIView(UIViewAnimationWithBlocks)

+ (void)animateWithDuration:(NSTimeInterval)duration delay:(NSTimeInterval)delay options:(UIViewAnimationOptions)options animations:(void (^)(void))animations completion:(void (^)(BOOL finished))completion __OSX_AVAILABLE_STARTING(__MAC_NA,__IPHONE_4_0);

with error:

/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS4.1.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIView.h:250:0 /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS4.1.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIView.h:250: error: expected `)' before '(' token

#7
09/25/2010 (10:32 am)
*bump* Sven please do you have the files/code changes to fix this keyboard issue? It's really blocking my progress!
#8
09/27/2010 (10:21 am)
i have exactly the same problem, also blocking my progress, have any solution? thank you!
#9
09/27/2010 (2:02 pm)
To fix /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS4.1.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIView.h:250:0 /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS4.1.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIView.h:250: error: expected `)' before '(' token

You need to set GCC 4.2 in the c/c++ compiler version.

for more info check
www.torquepowered.com/community/resources/view/19979
#10
09/27/2010 (2:40 pm)
Thanks - I guess I'll have to try upgrading again..
#11
09/27/2010 (10:57 pm)
Finally got it all working - thanks!