class pScreen extends PopupScreen implements KeyListener{
public boolean keyChar(char key, int status, int time) {
if (key == Characters.ESCAPE)
close();
return false;
}
}
keyChar
public boolean keyChar(char key, int status, int time)
-
Invoked when a sequence of zero or more keyDowns generates a character.
Most applications will want to use this function over the others. It will be invoked when a character is generated.
-
-
Parameters:
-
key
- Character generated, after any effects of the ALT or SHIFT keys and any complex keyboard mappings. -
status
- Status of the ALT, SHIFT and CAPS LOCK keys. -
time
- Number of milliseconds since the device was turned on.
Returns:
- True if the event was consumed.
-
- 这里的return是什么意思,看字面没有理解….谁理解了留言一下.