User input is generally handled by classes inheriting from GWCanvas (thus also GWForm, GWList, GWGrid, etc…).
In Gear application (but in general in J2ME applications) there are 3 types of inputs available: commands (triggered by soft keys), keypad and touchscreen.
Adding command-based interaction support to your widget requires you to follow these 3 steps: make your widget implement “GWCommandListener” interface, register the class as a command listener by adding the “setCommandListener(this)” call to your widget constructor and finally add one or two commands to your widget using the “addCommand()” method (either using CommonCommands or custom created commands)
To handle keypad inputs (fire button and arrow keys) just override the proper methods in your widget ( rightArrowPressed(), leftArrowPressed(), upArrowPressed(), downArrowPressed(), and firePressed() ).
Touch screen events maybe handled in two different ways: as pointer events and as gesture based events.
To handle pointer events just override the proper methods in your widget ( gwPointerReleased(), gwPointerPressed() and gwPointerDragged() ).
To implement a gesture based interaction you should make your widget implement the “GWGestureListener” interface, you should register the class as a gesture listener by adding the “setGestureListener(this)” call to your widget constructor and finally you should implement the GWGestureListener methods to associate actions to the different gestures.
Note that GWList, GWScrollableList, GWGrid, GWTextView and GWTextEdit are high level widgets which already handle keypad and pointer based input.
For more details you can download this java class extracted from the upcoming gear tutorial that shows how to handle some of the inputs described in the post.
I hope your question has been fully answered, for any request don’t hesitate to ask again.