How to detect number keys in a NativeEvent?

2013-02-09 Thread membersound
Hi, looking at NativeEvent extends JavaScriptObject: how can I detect if the event was a number? I tried using Character.isDigit(event.getKeyCode()), but this would give me an error: The method isDigit(char) in the type Character is not applicable for the arguments (int) How could I else

Re: How to detect number keys in a NativeEvent?

2013-02-09 Thread Andrea Boscolo
Check if event.getKeyCode() is between 48 and 57 (0 to 9 inclusive). And do the same for the keypad, if necessary. On Saturday, February 9, 2013 5:43:19 PM UTC+1, membersound wrote: Hi, looking at NativeEvent extends JavaScriptObject: how can I detect if the event was a number? I tried