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

@@ -588,12 +588,17 @@ void JGE::SendCommand(string command)
#if defined (ANDROID)
sendJNICommand(command);
#endif
#ifdef IOS
}
void JGE::SendCommand(std::string command, std::string parameter)
{
#if defined (IOS)
// get the app delegate and have it handle the command
wagicAppDelegate *delegate = [ [UIApplication sharedApplication] delegate];
const char* commandString = command.c_str();
DebugTrace("Command: "<< command << endl);
[delegate handleWEngineCommand:[NSString stringWithUTF8String: commandString]];
DebugTrace("Command: "<< command << " with parameter: " << parameter << endl);
[delegate handleWEngineCommand:[NSString stringWithCString: command.c_str() encoding: NSUTF8StringEncoding]
withParameter: [NSString stringWithCString: parameter.c_str() encoding:NSUTF8StringEncoding]];
#endif
}