In the javascript Event
object, there are some boolean values to check if modifier keys are pressed:
ctrlKey
: CTRL key.altKey
: ALT key.altLeft
: ALT left key. Only for IE.altGraphKey
: ALTGR key. Only for Chrome/Safari.
However, there are some issues:
- IE and Chrome set
ctrlKey
totrue
andaltKey
totrue
when you press the ALTGR modifier. - Firefox sets
ctrlKey
tofalse
andaltKey
totrue
when you press the ALTGR modifier, as only ALT has been pressed. - Chrome has the
altGraphKey
property, but it is alwaysundefined
.
Question: how can I difference between an ALT+CTRL or an ALTGR key press? Specially in Chrome.