Help Center

Local Navigation

Determine the type of input method

  1. Import one or more of the following classes:
    • net.rim.device.api.ui.Screen
    • net.rim.device.api.ui.Field
  2. Import the net.rim.device.api.system.KeypadListener interface.
  3. Implement the net.rim.device.api.system.KeypadListener interface.
  4. Extend the Screen class, the Field class, or both.
  5. In your implementation of one of the navigationClick, navigationUnclick, or navigationMovement methods, perform a bitwise AND operation on the status parameter to yield more information about the event. In the following code sample, we implement the navigationClick(int status, int time) method to determine if the trackwheel or a four way navigation input device triggers an event.
    	public boolean navigationClick(int status, int time) {
    	if ((status & KeypadListener.STATUS_TRACKWHEEL) == KeypadListener.STATUS_TRACKWHEEL) {
    		//Input came from the trackwheel
    	} else if ((status & KeypadListener.STATUS_FOUR_WAY) == KeypadListener.STATUS_FOUR_WAY) {
    //Input came from a four way navigation input device 
    	}
    	return super.navigationClick(status, time); }
    
    For more information about status modifiers, see the API reference for the class net.rim.device.api.system.KeypadListener.

Index


Was this information helpful? Send us your comments.