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
.
Respond to BlackBerry device user interaction
1.
Import the
net.rim.device.api.ui.Screen
class.
2.
Use the
Screen
class and its subclasses to provide a menu for the BlackBerry® device users to perform actions.
Touch screen events
Types of touch screen events
A
TouchEvent
class represents a touch input action that a BlackBerry® device user performs.
A
TouchGesture
class represents an event that is a combination of touch input actions that a BlackBerry device user performs.
Action
Event
Result
touch the screen
lightly
net.rim.device.api.ui
.TouchEvent.DOWN
This action highlights an item or places the cursor in a specific
location. It is equivalent to rolling the trackball or trackwheel to
highlight an item or place the cursor.
In applications that support a full-screen view, such as
BlackBerry® Maps, this action hides the banner and shortcut bar.
Development Guide
Touch screen events
31