12-21-2009 07:42 AM
I'm developing a J2ME applicaction for usual cell phones and for BlackBerry. The BlackBerry version of the aplicaciton is almost all in J2ME except for some references to the BlackBerry API.
My problem is that I'm getting the keycode of the key pressed by the user with the function:
and when I use that keyCode to get the character of the key pressed with the function:
char charBB = net.rim.device.api.ui.Keypad.map(keyCode);
it does't work and I always get the character '\u0000'
I've also tested with this code but neither work:
int keyBB = net.rim.device.api.ui.Keypad.key(keyCode);
int statusBB = net.rim.device.api.ui.Keypad.status(keyCode);
char charBB = net.rim.device.api.ui.Keypad.map(keyBB, statusBB);
And also this code neither work:
char charBB = net.rim.device.api.ui.KeypadUtil.getKeyChar(keyCod
I've debuged the code, and for example pressing the key "J" on the BlackBerry keyboard i get:
keyCode = 106
keyBB = 0
statusBB = 106
charBB = '\u0000'
charBB should be 'j' instead of '\u0000'
Why it doesn't work?
The problem could be the way of getting the keyCode, I use Canvas.keyPressed(int keyCode) and perhaps it should be done with the BlackBerry KeyListener. But I use the Canves.keyPressed(int keyCode) because this application also runs in usual J2ME cell phones.
Is there any way to get the character pressed on the BlackBerry keyboard and continue ussing Canvas.keyPressed(int keyCode)?
11-25-2013 02:09 AM
This topic has now been locked as it has been dormant for some time.
If you want to discuss this further or you have a similar question/issue please create a new post.