Results 1 to 4 of 4
January 7th, 2011, 04:40 PM #12,702Seņor Member
Greatest "keyCode" value for KeyboardEvent
Does anyone know the greatest possible value the "keyCode" property will return?
I'm mostly worried about international keyboards.
I'm wanting to release a few KeyboardEvents myself using some rather nifty code (if I may say so myself) and want to make sure there are no future conflicts.
Each of my "special keys" have a unique id numbered sequentially. Is there anywhere I can start my numbering from where I can be safe from conflicting key codes?
January 7th, 2011, 05:12 PM #2
would negative integers or fractions be applicable ?
January 7th, 2011, 05:29 PM #32,702Seņor Member
Ah, nice thinking.
The "KeyboardEvent.keyCode" property is a "uint", but it may be possible to change that property in my class to an "int", though, if you pass a uint to it with a number greater than the max value of it, it will convert to a negative number anyway.
As metju mentioned via IRC, if I pick a really high number, it shouldn't conflict with anything. But I'm still curious to know the "current theoretical maximum". (where is GlosRFC? If anyone, he should know.
January 7th, 2011, 08:17 PM #4
yep, GlosRFC'll know I had a look out of curiosity and it got tricky because windows seems to have key codes altered with pressing the alt key in order to get any non-english characters. I know in japan you can just use a normal keyboard so I imagine same number of keys = same number of key codes ? what if you take say all the key codes and convert them back into characters - so start at 255 and increment up tracing the key-code to character and see when it breaks ?
<edit> ok that was a dumb idea - at 10000 I realized why.