Development Guide
Local Navigation
- UI
- Fundamental UI components
- Drawing directly on a screen
- UI life cycle
- UI components
- Events
- Command Framework API
- Arranging UI components
- Advanced UI components and managers
- Menu items
- Fonts
- Spelling checker
- Barcode scanning
- BlackBerry device user input and navigation
- Navigation events
- Respond to navigation events
- Determine the type of input method
- Touch screen interaction models
-
Responding to touch screen events
- Respond to system events while the user touches the screen
- Respond to a user sliding a finger up quickly on the screen
- Respond to a user sliding a finger down quickly on the screen
- Respond to a user sliding a finger to the left quickly on the screen
- Respond to a user sliding a finger to the right quickly on the screen
- Respond to a user clicking the screen
- Respond to a user touching the screen twice quickly
- Respond to a user touching and dragging an item on the screen
- Respond to a user touching the screen lightly
- Respond to a scroll action
- Respond to a user touching the screen in two locations at the same time
- Pinch gestures
- Swipe gestures with trackpads
- Event injection
- Accelerometer
- Magnetometer
- Tutorial: Creating a custom button
- Related resources
- Glossary
- Provide feedback
- Document revision history
- Legal notice
BlackBerry Manuals & Help
>
Developer Documentation
>
Java Development Guides and API Reference
>
Development Guide
UI and Navigation - BlackBerry Java SDK - 7.0
Determine the type of input method
- Import one or more of the following classes:
- Import the net.rim.device.api.system.KeypadListener interface.
- Implement the net.rim.device.api.system.KeypadListener interface.
- Extend the Screen class, the Field class, or both.
- 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. Implement the navigationClick(int status, int time) method to
determine if the trackwheel or a four way navigation input device (for example, a trackball) 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 for the net.rim.device.api.system.KeypadListener class, see the API reference for the BlackBerry® Java® Development Environment.
Next topic: Touch screen interaction models
Previous topic: Respond to navigation events