Sunday, February 10, 2013

Re: KeyCodes not containing KEY_SPACE?

AFAICT, KeyCodes only includes the most useful key codes, for those keys that won't generate a KeyPress event (in most browsers except Firefox). KEY_ENTER, while generally generating a KeyPress (a buggy one in Firefox) might trigger form submission so was probably worth including here. Honestly, key events are a real mess; good luck if you start playing with them, and make sure you test in absolutely all browsers, including on different platforms (Linux, Windows, OSX).

For your "number input" use-case, you'd better use an <input type=number> and validate/fix the value in the end (for those browsers that don't support type=number and will fallback to a type=text). Believe me, you already have enough issues to deal with without adding key event handling to the list.

On Sunday, February 10, 2013 11:30:48 AM UTC+1, membersound wrote:
Hi,

maybe I'm missing something, but is there any reason com.google.gwt.event.dom.client.KeyCodes does not contain KEY_SPACE = 32?
Is this contained in a different class? Or omitted for any reason?

--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscribe@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

No comments:

Post a Comment