How to handle keystrokes in a J2ME GUI application
I have programmed bluetooth Television-Remote control for mobile phones in J2ME using javax.microedition.lcdui.*
(Gauge, List, ChoiseGroup) GUI-Elements.
I want the cell phone to have real-time interaction with my TV, I would like to find a way to immediately send custom inputs made with GUI-Elements (like change channel or change volume) to the TV.
Since I require real-time interaction with my TV, I would like to find a way to immediately send custom inputs made with GUI-Elements (like change channel or change volume) to the TV.
Using javax.microedition.lcdui.Command
/ CommandListner
and commandAction
won't work as they have to recognize the commands selected with the side buttons. I would like to have something that can recognize any key pressed.
I found I Javax.microedition.lcdui.Canvas.keyPressed
can handle any key pressed on a mobile, but I don't know how to get Canvas to work with MIDP GUI elements like Gauge. They cannot be added as Commands.
Should I figure out a way to create an interface for these GUI elements to make them work with Canvas?
source to share