# Firefox handles Ctrl+number shortcut before keypress fired

**URL:** <https://discourse.mozilla.org/t/firefox-handles-ctrl-number-shortcut-before-keypress-fired/35837>\
**Category:** Development\
**Created:** [February 9, 2019, 7:53pm UTC](https://discourse.mozilla.org/t/firefox-handles-ctrl-number-shortcut-before-keypress-fired/35837 "2019-02-09T19:53:57Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![MeowHellYeah](https://avatars.discourse-cdn.com/v4/letter/m/d6d6ee/32.png) [@MeowHellYeah](https://discourse.mozilla.org/u/MeowHellYeah)\
**Post date:** [February 9, 2019, 7:53pm UTC](https://discourse.mozilla.org/t/firefox-handles-ctrl-number-shortcut-before-keypress-fired/35837/1 "2019-02-09T19:53:58Z")

</div>

I have `keypress` handler for Ctrl+number shortcuts in content script. It has `event.preventDefault()` and worked well not so long ago. But now browser doesn’t fire it and just do it’s default deed - switches tabs. `keydown` still works though. I made no updates - it happened suddenly. I found no info why.

UPD: I mean situation when Ctrl is held and I press any number.

---

<div class="post-metadata">

**Author:** ![freaktechnik](https://sea1.discourse-cdn.com/flex001/user_avatar/discourse.mozilla.org/freaktechnik/32/37766_2.png) [@freaktechnik](https://discourse.mozilla.org/u/freaktechnik)\
**Post date:** [February 9, 2019, 9:26pm UTC](https://discourse.mozilla.org/t/firefox-handles-ctrl-number-shortcut-before-keypress-fired/35837/2 "2019-02-09T21:26:50Z")

</div>

Sounds like [https://developer.mozilla.org/en-US/docs/Web/Events/keypress#Browser\_compatibility](https://developer.mozilla.org/en-US/docs/Web/Events/keypress#Browser_compatibility). As the top of that page mentions, you should use a different event like keydown or up.

Ctrl + 1 doesn’t produce a printable value, thus no event is fired.
