Detect Alt Gr (Alt Graph) modifier on key press

前端 未结 4 1643
野的像风
野的像风 2020-12-17 10:03

In the javascript Event object, there are some boolean values to check if modifier keys are pressed:

  • ctrlKey: CTRL key.
4条回答
  •  自闭症患者
    2020-12-17 10:48

    I guess the ALTGR key and CTRL+ALT key combo are the same thing and there is no way to make a difference in Javascript. Pressing ALTGR+e and CTRL+ALT+e are both producing the € (euro) symbol on my keyboard/language setup. There are pages online to check keycodes. Hope this helps.

提交回复
热议问题