Does Firefox 57 provide the keycode from keydown events?


(Ahasil) #1

Hello, I’m new to here.
It seems that Firefox 57 takes an apostrophe(`) and makes the keycode 0 (which is intended to be 96, I think).
So, I’ve got different results from Chrome. Is it normal, or only for me?

The site for testing:
http://unixpapa.com/js/testkey.html


(Martin Giger) #2

I’d recommend using the more modern key or code attributes to identify keys when possible. code is layout independent, so much better suited for keys like ` that some layouts do not even have. See https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/code


(Ahasil) #3

Wow, I didn’t know it can be done in that way although that feature has low compatibility yet.
Thank you for the response.