Dialog.alert("First finger touched/moved");
}
if(message.getX(2) > 0 && message.getY(2) > 0) {
Dialog.alert("Second finger touched/moved");
}
return true;
}
return false;
}
Keyboard on a BlackBerry device with a touch screen
A BlackBerry device application can have more that one
Screen
. Each
Screen
has one touch screen keyboard.
Change the state of 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
Steps
Retrieve the state of the touch screen
keyboard.
Invoke
VirtualKeyboard.getVisibility()
.
Change the state of the touch screen
keyboard.
Invoke
VirtualKeyboard.setVisibility(int)
.
Inherit the state of the touch screen
keyboard.
Invoke
VirtualKeyboard.setVisibility
(Virtual Keyboard.IGNORE)
.
Display the keyboard on a BlackBerry device with a touch screen
1.
Import the following classes:
Development Guide
Keyboard on a BlackBerry device with a touch screen
40