event.getKeyCode not returning correct for key up event

14 views
Skip to first unread message

SG

unread,
Aug 15, 2011, 1:43:59 PM8/15/11
to Google Web Toolkit
I am running GWT 2.3 in Standards mode and ran into this issue where
the getKeyCode method on the Event(com.google.gwt.user.client.Event)
object does not return correct values for special characters and also
those for letters seem to be inverted i.e. if I type 'S' I am getting
the code for 's' and vice versa. Any pointers on whats going on and
what I can do to fix. Below is a snippet of code that I am trying to
execute

Event event = DOM.eventGetCurrentEvent(); /* Note I do not have access
to the actual KeyUpEvent, so I need to use this */
char keyUpChar = (char)event.getKeyCode(); /* This returns 57 for the
'(' char which should be 40 and 83 for 's' which should be 115

Thanks!


Alex Dobjanschi

unread,
Aug 16, 2011, 10:08:29 AM8/16/11
to google-we...@googlegroups.com
If you're using a KeyUp/Down/Press/Handler, are you getting this too?
Reply all
Reply to author
Forward
0 new messages