X
Tap here to go to the mobile version of the site.

Support Forum

document.onkeypress does not work in versions after 61

Posted

https://jsfiddle.net/menzt4ja/

Mozilla Version 61.0 (64bit) Push key left See "ArrowLeft"

Mozilla Version 67.0b9 (64bit) Push key left Not see anithing

Key "Left,Up,Right,Down" does not work. Others key`s work fine.

https://jsfiddle.net/menzt4ja/ Mozilla Version 61.0 (64bit) Push key left See "ArrowLeft" Mozilla Version 67.0b9 (64bit) Push key left Not see anithing Key "Left,Up,Right,Down" does not work. Others key`s work fine.

Additional System Details

Application

  • User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:67.0) Gecko/20100101 Firefox/67.0

More Information

philipp
  • Top 25 Contributor
  • Moderator
5306 solutions 23424 answers

Helpful Reply

hi, https://developer.mozilla.org/en-US/docs/Web/API/GlobalEventHandlers/onkeypress says this is deprecated an onkeydown should be used instead...

hi, https://developer.mozilla.org/en-US/docs/Web/API/GlobalEventHandlers/onkeypress says this is deprecated an onkeydown should be used instead...
TyDraniu
  • Top 25 Contributor
316 solutions 1779 answers

Helpful Reply

onkeypress doesn't work with non-printable keys, onkeydown works.

See Non-printable keys no longer fire keypress event.

onkeypress doesn't work with non-printable keys, onkeydown works. See [https://www.fxsitecompat.com/en-CA/docs/2018/non-printable-keys-no-longer-fire-keypress-event/ Non-printable keys no longer fire keypress event].

Question owner

thank

thank