@Override protected void onUnload() { if (globalKeyHandlerRegistration != null) { globalKeyHandlerRegistration.removeHandler(); globalKeyHandlerRegistration = null; } super.onUnload(); }
@Override protected void onLoad() { super.onLoad(); globalKeyHandlerRegistration = Event.addNativePreviewHandler( new GlobalKeyEventHandler() { @Override protected void onKeyPress(char ch) { onKey(ch); } }); }