Ctrl-Shift-N doesn't trigger `keydown` event for `N` key
Categories
(Core :: DOM: UI Events & Focus Handling, defect, P5)
Tracking
()
People
(Reporter: javi, Unassigned)
References
(Blocks 1 open bug)
Details
User Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:101.0) Gecko/20100101 Firefox/101.0
Steps to reproduce:
I was trying to add a new keyboard shortcut to the site I work on that clashes with default "new private page" shortcuts on firefox
Actual results:
Pressing both ctrl+shift+P and ctrl+shift+N (same thing happens in iOS replacing ctrl for whatever the meta key of the macbooks is called) doesn't trigger the expected 'onKeyDown' events. Both Control and Shift key presses trigger the expected 'onKeyDown' event, but both the P and the N don't trigger anything (a new page / private page is opened instead, and when you go back to the tab where you were working, the event hasn't happened at all.
This can be replicated both in the linux built of Firefox 101.0.1 and the same version on iOS.
Expected results:
I would expect the browser to trigger the DOM event before doing anything else. That way the shortcut can be both used for different matters, and if needed, the default behaviour could be cancelled using event.preventDefault().
Comment 1•3 years ago
|
||
The Bugbug bot thinks this bug should belong to the 'Core::DOM: UI Events & Focus Handling' component, and is moving the bug to that component. Please correct in case you think the bot is wrong.
FYI: in iOS, we cannot ship Gecko so that it's really different product. We need handle issues on the other platforms and iOS separately.
About Ctrl
-Shift
-P
is a shortcut key for opening private browsing mode shortcut key and it is reserved. Therefore, it does not fire P
key events except keyup
. Therefore, at least this is by design for protecting keyboard only users from malicious web apps which does not allow users to move focus outside the web content.
I'm not sure about Ctrl
-Shift
-N
. Ctrl
-N
is a reserved key for same reason. So, this behavior is unexpected.
If you want to use any shortcut keys as a user of specific web apps, you can change the setting from "Page Info" (Ctrl
- I
) -> "Permissions" -> "Override keyboard shortcuts".
Comment 3•3 years ago
|
||
(In reply to Masayuki Nakano [:masayuki] (he/him)(JST, +0900) from comment #2)
I'm not sure about
Ctrl
-Shift
-N
.Ctrl
-N
is a reserved key for same reason. So, this behavior is unexpected.
Ctrl
-Shift
-N
is "reopen closed window" so it makes sense that it is reserved.
Thank you, Brian. Then, both of them are reserved by Firefox. I.e., web apps cannot and should not override the behavior. Therefore, Firefox intentionally does not dispatch the corresponding keydown
event of the printable keys.
Description
•