I am developing an application that requires me to override keypressed and released methods in lwuit so as to map specific functons into gamekeys.
The gamekeys work fine when I do this but I'm having trouble adding more than two commands to application. Normally actionlistener would automatically handle the mapping of multiple commands but it does not.
Is it possible to map more than one command to a softkey (like with keycode -7) and have an if statement to dynamically check which command is pressed.
public void keyReleased(int keyCode) {
switch (keyCode) {
case -6: // left cmd key
function a();
return;
case -7: // right cmd key
//Need this to handle more than one command function
return;
}
//function to handle gamekeys
}
Hope I am clear enough with my issue. Please help