Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/gwt/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Gwt 如何用UIBinder捕捉按键事件_Gwt_Uibinder - Fatal编程技术网

Gwt 如何用UIBinder捕捉按键事件

Gwt 如何用UIBinder捕捉按键事件,gwt,uibinder,Gwt,Uibinder,在GWT+UiBinder中,您可以捕获如下单击: @UiHandler("cancelButton") void onCancelButtonClicked(ClickEvent e) { // cancel code goes here; } 按下的键是否有对应的键?例如,如果用户按下ESC键,则我们取消一个操作 非常感谢。这应该可以: @UiHandler("myWidget") void onKeyDown(KeyDownEvent e) { // key down cod

在GWT+UiBinder中,您可以捕获如下单击:

@UiHandler("cancelButton")
void onCancelButtonClicked(ClickEvent e) {
    // cancel code goes here;
}
按下的键是否有对应的键?例如,如果用户按下ESC键,则我们取消一个操作

非常感谢。

这应该可以:

@UiHandler("myWidget")
void onKeyDown(KeyDownEvent e) {
  // key down code goes here
}
小部件必须实现
HasKeyDownHandlers