Development Guide
• net.rim.device.api.ui.VirtualKeyboard
• a Screen class, such as net.rim.device.api.ui.container.MainScreen
2.
Create an instance of VirtualKeyboard.
VirtualKeyboard virtKbd;
3.
Store an instance of a screen class.
MainScreen _screen = new MainScreen( MainScreen.VERTICAL_SCROLL );
4.
Invoke getVirtualKeyboard() and store the return value in the VirtualKeyboard variable.
virtKbd = _screen.getVirtualKeyboard();
5.
Perform one of the following tasks:
Task
Always display the touch screen
keyboard.
Display the touch screen keyboard on
a new screen.
Hide the keyboard on a BlackBerry device with a touch screen
1.
Import the following classes:
• net.rim.device.api.ui.VirtualKeyboard
• a screen class, such as net.rim.device.api.ui.container.MainScreen
2.
Create an instance of VirtualKeyboard.
VirtualKeyboard virtKbd;
3.
Store an instance of a screen class.
MainScreen _screen = new MainScreen( MainScreen.VERTICAL_SCROLL );
4.
Invoke getVirtualKeyboard() and store the return value in the VirtualKeyboard variable.
virtKbd = _screen.getVirtualKeyboard();
5.
Perform one of the following tasks:
Task
Always hide the touch screen
keyboard.
Steps
Invoke VirtualKeyboard.setVisibility
(VirtualKeyboard.SHOW_FORCE).
Invoke VirtualKeyboard.setVisibility(int) using one of the
following constants as a parameter: VirtualKeyboard.SHOW or
VirtualKeyboard.SHOW_FORCE.
Steps
Invoke VirtualKeyboard.setVisibility
(VirtualKeyboard.HIDE_FORCE).
Keyboard on a BlackBerry device with a touch screen
41