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
ctrlKeytotrueandaltKeytotruewhen you press the ALTGR modifier. - Firefox sets
ctrlKeytofalseandaltKeytotruewhen you press the ALTGR modifier, as only ALT has been pressed. - Chrome has the
altGraphKeyproperty, but it is alwaysundefined.
Question: how can I difference between an ALT+CTRL or an ALTGR key press? Specially in Chrome.