Also see http://code.google.com/p/google-web-toolkit/issues/detail?id=5558for
a workaround.

/dmc

On Fri, Dec 3, 2010 at 3:36 PM, Brian Reilly <brian.irei...@gmail.com>wrote:

> Greg,
>
> As I mentioned in a thread earlier today (
> http://groups.google.com/group/google-web-toolkit/browse_thread/thread/82a98103dfa76528),
> try using a KeyDownEvent handler and inspect 
> event.getNativeEvent().getKeyCode()
> instead of event.getCharCode().
>
> From the other thread, it sounds like this behavior may have changed in
> 2.1, so it could be that the documentation is wrong, but only as of fairly
> recently.
>
> -Brian
>
> On Fri, Dec 3, 2010 at 3:21 PM, Greg Dougherty <dougherty.greg...@mayo.edu
> > wrote:
>
>> Ok, the tutorial says that to get a user pressing an enter key in a
>> TextBox you should write something like the following:
>>
>> http://code.google.com/webtoolkit/doc/latest/tutorial/manageevents.html
>>
>>        public void onKeyPress (KeyPressEvent event)
>>        {
>>                char    keyPress = event.getCharCode();
>>                int     keyCode = keyPress;
>>                if (keyPress == KeyCodes.KEY_ENTER)
>>                        goToRecord ();
>>        }
>>
>> Unfortunately, when I do that, I get a keyCode of 0 for  Enter, Tab,
>> and Left Arrow (the keys I tested), while I get the actual key when I
>> type a number key.  What gives?  Is the tutorial wrong?  If so, what
>> should I be calling?
>>
>> TIA,
>>
>> Greg
>>
>> --
>> 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-web-tool...@googlegroups.com.
>> To unsubscribe from this group, send email to
>> google-web-toolkit+unsubscr...@googlegroups.com<google-web-toolkit%2bunsubscr...@googlegroups.com>
>> .
>> For more options, visit this group at
>> http://groups.google.com/group/google-web-toolkit?hl=en.
>>
>>
>  --
> 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-web-tool...@googlegroups.com.
> To unsubscribe from this group, send email to
> google-web-toolkit+unsubscr...@googlegroups.com<google-web-toolkit%2bunsubscr...@googlegroups.com>
> .
> For more options, visit this group at
> http://groups.google.com/group/google-web-toolkit?hl=en.
>



-- 
David Chandler
Developer Programs Engineer, Google Web Toolkit
http://googlewebtoolkit.blogspot.com/

-- 
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-web-tool...@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.

Reply via email to