in Firefox9, when i press enter key, enent.getCharCode() is 0.

36 views
Skip to first unread message

yl chen

unread,
Feb 2, 2012, 10:14:20 PM2/2/12
to Google Web Toolkit
newSymbolTextBox = new TextBox();
newSymbolTextBox.addKeyPressHandler(new KeyPressHandler() {
public void onKeyPress(KeyPressEvent event) {
Window.alert("keycode:"+(int)event.getCharCode());
if (event.getCharCode() == KeyCodes.KEY_ENTER){
addStock();
}

}
});

in ie. when i press enter key, event.getCharCode() is 13.
in Firefox9, when i press enter key, enent.getCharCode() is 0.

Juan Pablo Gardella

unread,
Feb 3, 2012, 6:55:22 AM2/3/12
to google-we...@googlegroups.com
Use event.getNativeCode (or simillar)


--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To post to this group, send email to google-we...@googlegroups.com.
To unsubscribe from this group, send email to google-web-tool...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.


Thomas Broyer

unread,
Feb 3, 2012, 7:04:11 AM2/3/12
to google-we...@googlegroups.com
Reply all
Reply to author
Forward
0 new messages