Allow existing (built-in) menu shortcuts to be reassigned as custom shortcuts via System Preferences
Categories
(Core :: Widget: Cocoa, defect, P3)
Tracking
()
People
(Reporter: spohl, Assigned: spohl)
References
Details
(Whiteboard: [tpi:+])
Attachments
(2 files, 4 external files)
|
7.35 KB,
patch
|
Details | Diff | Splinter Review | |
|
351.03 KB,
image/png
|
Details |
| Assignee | ||
Comment 1•9 years ago
|
||
Any progress with this? It's truly annoying on macOS. Even Excel, Word, Powerpoint now handle this correctly
| Comment hidden (off-topic) |
Updated•6 years ago
|
| Comment hidden (off-topic) |
| Comment hidden (off-topic) |
| Comment hidden (off-topic) |
| Comment hidden (off-topic) |
Comment 16•6 years ago
|
||
(In reply to Stephen A Pohl [:spohl] from comment #0)
- Use the existing mechanics to set the built-in shortcuts, but remove the
internal handling of the shortcuts via XBL prototype handlers[1] and let the
native menu system handle them instead. This is scary because of the code we
currently use to walk and execute our handlers[2]. It is unknown if this
special handling is necessary and whether we can achieve the same via the
native menu system.
I'd like to try to fix this bug. Could you point me to the resources on what "XBL prototype handlers" are?
Comment 17•6 years ago
|
||
[Tracking Requested - why for this release]:
| Assignee | ||
Comment 18•6 years ago
|
||
(In reply to hongsy2006 from comment #16)
(In reply to Stephen A Pohl [:spohl] from comment #0)
- Use the existing mechanics to set the built-in shortcuts, but remove the
internal handling of the shortcuts via XBL prototype handlers[1] and let the
native menu system handle them instead. This is scary because of the code we
currently use to walk and execute our handlers[2]. It is unknown if this
special handling is necessary and whether we can achieve the same via the
native menu system.I'd like to try to fix this bug. Could you point me to the resources on what "XBL prototype handlers" are?
This is referenced in comment 0, in particular link [2]. You should expect to have to do a lot of debugging in the actual code to get a better understanding of the mechanisms here. Other resources will be limited at best and I wouldn't know of any off-hand.
Please do not change tracking flags.
Comment 20•5 years ago
|
||
(In reply to hongsy2006 from comment #16)
I'd like to try to fix this bug. Could you point me to the resources on what "XBL prototype handlers" are?
This has been driving me crazy lately. Did you make any headway on this that can be shared?
| Comment hidden (advocacy) |
Comment 25•4 years ago
|
||
Team, any news on this bug? This one has been raised 5 years ago, any option to have it fixed soon?
Thanks
Updated•4 years ago
|
Comment 28•4 years ago
|
||
The severity field for this bug is relatively low, S3. However, the bug has 13 duplicates and 11 votes.
:spohl, could you consider increasing the bug severity?
For more information, please visit auto_nag documentation.
Comment 29•4 years ago
|
||
The last needinfo from me was triggered in error by recent activity on the bug. I'm clearing the needinfo since this is a very old bug and I don't know if it's still relevant.
| Assignee | ||
Comment 30•4 years ago
|
||
This bug is still relevant and the severity of S3 is correct.
Comment 31•4 years ago
|
||
Thunderbird has quite a lot of default shortcuts, and some of them are outright dangerous since they require no modifier keys: it happens regularly that I think I am typing in the 'filter' field, but Thunderbird actually interprets my keystrokes as shortcuts. Then I spend the next 10min trying to figure out what my 10 keystrokes did and un-doing that. (In particular un-doing an accidental "ignore thread" is really hard.)
I think the severity should be raised, at least to provide a way to disable/remap the potentially destructive modifier-free shortcuts (J, K -- maybe there are others but these are the most painful).
Comment 32•3 years ago
|
||
As a left-hander, it is extremely difficult for me to use Firefox when I need to cut, copy or paste something. The standard keyboard shortcuts Cmd + X, Cmd + C and Cmd + V do not suit me and are very inconvenient, which is why I assigned these functions to the F13, F14 and F15 keys on the Apple Magic Keyboard with Touch ID and Numeric Keypad. And these keys work great in Safari, Chrome, and the entire system, including Spotlight. But they don't work in Firefox, and that's terribly annoying! π
Comment 33•3 years ago
|
||
Comment 34•3 years ago
|
||
Encountering the same problem.
Comment 35•3 years ago
|
||
I remapped the copy/paste/cut/undo/redo.
only undo works with both shortcuts command+z / ctrl+z , which is curios.
Name Firefox
Version 108.0.1
Build ID 20221215175817
Update Channel release
User Agent Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:108.0) Gecko/20100101 Firefox/108.0
OS Darwin 22.2.0 Darwin Kernel Version 22.2.0: Fri Nov 11 02:03:51 PST 2022; root:xnu-8792.61.2~4/RELEASE_ARM64_T6000
Comment 36•3 years ago
|
||
(In reply to RenΓ© W. from comment #35)
I remapped the copy/paste/cut/undo/redo.
only undo works with both shortcuts command+z / ctrl+z , which is curios.
Name Firefox Version 108.0.1 Build ID 20221215175817 Update Channel release User Agent Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:108.0) Gecko/20100101 Firefox/108.0 OS Darwin 22.2.0 Darwin Kernel Version 22.2.0: Fri Nov 11 02:03:51 PST 2022; root:xnu-8792.61.2~4/RELEASE_ARM64_T6000
Will this change appear in the next version of Firefox? Or do you need permission from the developers?
Comment 37•3 years ago
|
||
My understanding is that S3 means "Blocks non-critical functionality and a work around exists".
From what I can see, there is no workaround available here. If a workaround does exist, I'd appreciate it if someone would let me know.
| Assignee | ||
Comment 38•3 years ago
|
||
(In reply to me from comment #37)
From what I can see, there is no workaround available here. If a workaround does exist, I'd appreciate it if someone would let me know.
All menu items are accessible via the menu bar, clicking on the respective menu and selecting the desired menu item.
| Comment hidden (advocacy) |
| Comment hidden (advocacy) |
| Comment hidden (advocacy) |
| Comment hidden (advocacy) |
| Comment hidden (advocacy) |
Comment 44•2 years ago
|
||
This bug has been bothering me for a long time, so I decided to fix it:
https://gist.github.com/Wowfunhappy/b09900c5420767651338a57692348e31
Compile this into a dylib (you'll need ZKSwizzle) and inject it into Firefox via DYLD_INSERT_LIBRARIES or similar. Unfortunately, modern macOS makes code injection kind of annoying, but it is still possible. I'm pretty happy with it >160 lines of code.
The code works by intercepting key events, checking if they match any user-defined key equivalents in NSUserDefaults, and if they do, executing the matching menu item instead of passing the event to Firefox.
I'm not sure if this helps, since I imagine you wouldn't want to do it this way in the actual Firefox codebaseβbut you could and it does work, so I wanted to share. If you have any questions, please ask!
| Assignee | ||
Comment 47•1 month ago
|
||
A keyset builds its handler chain once, so changing a key element's key, modifiers or similar attributes has no effect until the keyset is re-inserted into the document. The keyset now marks its handlers stale on such a change and rebuilds them at the next key event. The rebuild waits while a walk of the handlers is running script.
Updated•1 month ago
|
| Assignee | ||
Comment 48•1 month ago
|
||
The menu bar ran a highlight-only pass for every Command shortcut before the page saw the key, so menus flashed for keys the page consumed and for disabled commands, sometimes twice. That pass is gone. When a key element runs its command, the menu item showing that shortcut is highlighted through performActionForItemAtIndex: with its action switched off, which is the same AppKit path a key equivalent takes. Keys without Command still stay with a native key window such as a sheet, as bug 2060306 requires, and for Command keys the menu bar now reports whether it handled the key instead of always returning NO.
| Assignee | ||
Comment 49•1 month ago
|
||
AppKit honors a shortcut the user assigns to a menu item in System Settings, but Gecko kept running the built-in shortcut first. The menu bar now runs an item whose assigned shortcut matches the key and consumes the event, so neither Gecko nor web content sees it. The XUL key element is rewritten to the assigned shortcut and keeps its own values in data-builtin-* attributes, so tooltips and about:keyboard show the shortcut that actually works. AppKit applies assignments when an item is inserted into a menu and announces later changes through NSMenuDidChangeItemNotification, so the sync runs at those points.
| Assignee | ||
Comment 50•1 month ago
|
||
While a System Settings assignment is in effect, a customization made in about:keyboard goes into the key element's data-builtin-* copies, so it applies once the assignment is removed instead of fighting it. about:keyboard shows where such a shortcut comes from and doesn't offer to change it. The keyset re-append workaround is gone, since key elements now take attribute changes in place.
Updated•1 month ago
|
| Assignee | ||
Comment 51•25 days ago
|
||
I'm setting a needinfo on myself to land this on 10/22, once the Firefox 161 Nightly cycle starts. QA coverage has been requested in https://mozilla-hub.atlassian.net/browse/QA-5854, and the plan is for QA to test it in Nightly 161.
| Assignee | ||
Comment 52•15 days ago
|
||
Rebased patches have been sent to try before landing on m-c: https://treeherder.mozilla.org/jobs?repo=try&landoInstance=lando-prod-2025&landoCommitID=109175
| Assignee | ||
Comment 53•11 days ago
|
||
I have been coordinating with QA and this is ready to be tested as soon as it lands. Queued for landing.
Comment 54•11 days ago
|
||
Comment 55•11 days ago
|
||
| bugherder | ||
https://hg.mozilla.org/mozilla-central/rev/4b8b450fbb5a
https://hg.mozilla.org/mozilla-central/rev/aee194e4fc59
https://hg.mozilla.org/mozilla-central/rev/1096293273e9
https://hg.mozilla.org/mozilla-central/rev/9e5021a79c94
Comment 56•11 days ago
|
||
Did you want to nominate this for the Fx161 relnotes? If so, set the relnote-firefox flag to "?"
https://wiki.mozilla.org/Release_Management/Release_Notes_Nomination
Possible wording:
On macOS, keyboard shortcuts assigned to Firefox menu items in System Settings now replace the built-in shortcuts for those items.
| Assignee | ||
Comment 57•10 days ago
|
||
Thank you for the reminder!
Release Note Request (optional, but appreciated)
[Why is this notable]: As far back as 2008, we had reports that user-defined shortcuts didn't work as intended. While this was addressed for shortcuts that were not already used as a built-in shortcut in 2017 (bug 429824), the much more complex problem of allowing built-in shortcuts to be reassigned dragged on. After over 18 years, 15 duplicate bug reports and 50 people in CC, this appears to finally be fully fixed.
[Affects Firefox for Android]: no
[Suggested wording]: On macOS, keyboard shortcuts assigned to Firefox menu items in System Settings now replace the built-in shortcuts for those items.
[Links (documentation, blog post, etc)]: n/a
Updated•1 day ago
|
Description
•