首页 » 黑莓开发 » 监听按键ESC退出PopupScreen框

监听按键ESC退出PopupScreen框

4478 1

class pScreen extends PopupScreen implements KeyListener{
public boolean keyChar(char key, int status, int time) {
if (key == Characters.ESCAPE)
close();
return false;
}
}

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.

文章评分1次,平均分5.0

本文原始地址:https://www.tiandiyoyo.com/2009/10/how-to-pop-popupscreen/
本站所有文章,除了特别注明外,均为本站原创,转载请注明出处来自www.tiandiyoyo.com

您可能还会对以下文章感兴趣:

评论前先开启评论开关:


1 Comment

  1. 斌果 :

    噗,什么也不说了

载入分页评论...