
Everton da Rosa - 2015-06-12 17:01:19 -
In reply to message 1 from Stefan Drugda
Indeed, this code only works in FF because WebKit (Chrome, Opera and Safari) does not yet implement KeyboardEvent.key (which is a new specification).
I could have used KeyboardEvent.keyCode, but this would require the user to know the numerical value of each key, or else I would have to implement a "translator".
We expect the WebKit soon implement this new specification. As for IE, the documentation states that KeyboardEvent.key is supported in IE9.
I confess that I was wrong to not mention that only works in FF (developed and tested only in that browser). Excuse me.
It might be a good opportunity for someone improve code enabling the use of KeyboardEvent.key or KeyboardEvent.keyCode, as detect the support KeyboardEvent.key, implementing a character translation in order for its numerical value. Maybe I'll do it soon.