|
MIDP3.0 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface KeyListener
Classes implementing this interface provide methods that are called when user of the device will generate key events, for example, pressing the keys available in a system keypad or keyboard. When a key is pressed, held down or released, the appropriate method will be invoked. The methods have following parameters:
Canvas.setKeyListener()
method and CustomItem.setKeyListener()
.
Field Summary | |
---|---|
static int |
MODIFIER_ALT
Key modifier mask indicating the Alt key. |
static int |
MODIFIER_CHR
Key modifier mask indicating the Chr key. |
static int |
MODIFIER_COMMAND
Key modifier mask indicating the Command key. |
static int |
MODIFIER_CTRL
Key modifier mask indicating the Control / Ctrl key. |
static int |
MODIFIER_MASK
A bitmask for all key modifiers. |
static int |
MODIFIER_SHIFT
Key modifier mask indicating the SHIFT key. |
Method Summary | |
---|---|
void |
keyPressed(int keyCode,
int keyModifier)
Called when a key is pressed. |
void |
keyReleased(int keyCode,
int keyModifier)
Called when a key is released. |
void |
keyRepeated(int keyCode,
int keyModifier)
Called when a key is repeated (held down). |
Field Detail |
---|
static final int MODIFIER_ALT
static final int MODIFIER_SHIFT
static final int MODIFIER_CTRL
static final int MODIFIER_COMMAND
static final int MODIFIER_CHR
static final int MODIFIER_MASK
Method Detail |
---|
void keyPressed(int keyCode, int keyModifier)
keyCode
- the key code of the key that was pressedkeyModifier
- the key modifier mask of the modifier key that was pressedvoid keyReleased(int keyCode, int keyModifier)
keyCode
- the key code of the key that was releasedkeyModifier
- the key modifier mask of the modifier key that was releasedvoid keyRepeated(int keyCode, int keyModifier)
keyCode
- the key code of the key that was held downkeyModifier
- the key modifier mask of the modifier key that was held down
|
MIDP3.0 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |