Works only with Firefox

Recommend this page to a friend!

      JavaScript Keyboard Shortcuts  >  All threads  >  Works only with Firefox  >  (Un) Subscribe thread alerts  
Subject:Works only with Firefox
Summary:not works
Messages:2
Author:Stefan Drugda
Date:2015-06-12 13:16:39
 

  1. Works only with Firefox   Reply   Report abuse  
Picture of Stefan Drugda Stefan Drugda - 2015-06-12 13:16:39
No Chrome
No MSIE 11
no Opera

  2. Re: Works only with Firefox   Reply   Report abuse  
Picture of Everton da Rosa 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.