Created
August 20, 2009 23:03
-
-
Save boscomonkey/171494 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Java snippet for GWT to trap keyboard keyUp events at the document level. | |
// In other words, no KeyUpHandler needed (nor does Document provide a hook). | |
Event.addNativePreviewHandler(new Event.NativePreviewHandler() { | |
@Override | |
public void onPreviewNativeEvent(NativePreviewEvent event) { | |
if (event.getTypeInt() == Event.ONKEYUP) { | |
// do something with the key code | |
// doSomething(event.getNativeEvent().getKeyCode()); | |
event.cancel(); | |
} | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment