added new signature for SendCommand in JGE that takes in a command string and a parameter

added native keyboard handling in iOS
TODO: add same feature for Android tablets/phones
This commit is contained in:
techdragon.nguyen@gmail.com
2011-12-15 11:11:08 +00:00
parent f9016f70ab
commit dc7d52c48c
14 changed files with 785 additions and 535 deletions

View File

@@ -10,6 +10,8 @@
#include "JRenderer.h"
#include "JGameLauncher.h"
#include "GameApp.h"
#import "AdWhirlView.h"
#import "wagicAppDelegate.h"
@@ -532,6 +534,31 @@ static NSString *_MY_AD_WHIRL_APPLICATION_KEY_IPAD = @"2e70e3f3da40408588b9a3170
}
#pragma mark -
#include "GameOptions.h"
#pragma mark Keyboard related methods
- (void) updateKeyboard:( NSString *) inputString
{
// send the new string to JGE to update the string
unsigned char key = [inputString characterAtIndex: 0];
if ([inputString length] > 1)
{
if ([inputString isEqualToString: @"DELETE"])
key = 127;
else if ([inputString isEqualToString:@"SPACE"])
key = 32;
else if ([inputString isEqualToString: @"SAVE"])
key = 1;
else if ([inputString isEqualToString: @"CANCEL"])
key = 10;
}
options.keypadUpdateText( key );
if ( key < 11 )
g_engine->HoldKey_NoRepeat( JGE_BTN_OK) ;
}
//These are the methods for the AdWhirl Delegate, you have to implement them
#pragma mark AdWhirlDelegate methods