Closed Bug 2012218 Opened 7 months ago Closed 3 months ago

In about:keyboard the command (cmd) key is ignored in Linux while it is fine on MacOS

Categories

(Firefox :: Keyboard Navigation, defect)

Firefox 149
defect

Tracking

()

RESOLVED FIXED
152 Branch
Tracking Status
firefox152 --- fixed

People

(Reporter: enrico, Assigned: Jamie)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:149.0) Gecko/20100101 Firefox/149.0

Steps to reproduce:

  • open about:keyboard in Linux (I'm on the Ubuntu 24.04.3 LTS right now)
  • try to enter a 2 keys combination or 3 keys combination that is including the cmd/command button (the one between alt and spacebar)

Actual results:

  • the command key is ignored on Linux
    (the specific combination that I was trying is alt+command+right arrow)

Expected results:

  • that the combination (even with 3 keys) including command is accepted.
    On MacOS (26.1) I've tried the same about:keyboard and everything is fine so it is a problem affecting Linux

The Bugbug bot thinks this bug should belong to the 'Core::Widget: Cocoa' component, and is moving the bug to that component. Please correct in case you think the bot is wrong.

Component: Untriaged → Widget: Cocoa
Product: Firefox → Core
Component: Widget: Cocoa → Widget: Gtk
Priority: -- → P3

James, could you take a look on this since you have changed CustomKeysParent.sys.mjs recently.
According to handleEvent, it seems to ignore Meta key totally except on "macos".
And, according to onAction in customkeys.js it uses remote CustomKeysParent to handle keys if I read it correctly.

Severity: -- → S3
Flags: needinfo?(jteh)

On Windows, the Windows key (similar to Meta/Super on Linux) is generally reserved entirely for OS commands. Most of these OS commands can't be overridden, so allowing users to assign to them would end up being more confusing than useful. My understanding is that the same is true on Linux, but I'm happy to be corrected on that point. I based this decision on what the Add-ons Manager does. As I understand it, it doesn't support assigning to the Meta key either, but perhaps that's incorrect. If you install an extension with configurable shortcut keys and then try to change a shortcut, do you get an option for the Meta/Super key?

Blocks: customkeys
Flags: needinfo?(jteh)

(In reply to James Teh [:Jamie] from comment #3)

On Windows, the Windows key (similar to Meta/Super on Linux) is generally reserved entirely for OS commands. Most of these OS commands can't be overridden, so allowing users to assign to them would end up being more confusing than useful. My understanding is that the same is true on Linux, but I'm happy to be corrected on that point. I based this decision on what the Add-ons Manager does. As I understand it, it doesn't support assigning to the Meta key either, but perhaps that's incorrect. If you install an extension with configurable shortcut keys and then try to change a shortcut, do you get an option for the Meta/Super key?

Yes, with an extension such as Shortkeys (Custom Keyboard Shortcuts) I can also set Meta/Super/Command key correctly.
For example in the extension mentioned I've configured right now alt+command+right and alt+command+left now without issues

Here using Gnome I can change some preset shortcuts using GUI or gsettings set org.gnome.desktop.wm.keybindings
So from my tests on Linux there are not restrictions about the use of Meta/Super/Command. I've correctly set up alt+command+right and alt+command+left. I take as an example Gnome Terminal that has an UI to set up shortcuts similar to Firefox: Alt+Super+Left and Alt+Super+Right appear on Gnome Terminal as pressed without issues. And Gnome Terminal is part of the Gnome Project

I've tested right now another app of the Gnome Project: Gnome Builder. It also let you set Alt+Super+Left and Alt+Super+Right without problems

Component: Widget: Gtk → Keyboard Navigation
Flags: needinfo?(jteh)
Product: Core → Firefox

The product::component has been changed since the backlog priority was decided, so we're resetting it.
For more information, please visit BugBot documentation.

Priority: P3 → --

Hi Enrico. Assuming a default Firefox key binding of control+shift+y to open Downloads, what happens if you press control+shift+super+y? I can't test this myself on Linux because I'm using a Linux vm and the host keeps swallowing the Windows key. On Windows, doing this opens the Downloads window, which means the Windows key is being ignored somewhere instead of being treated as a modifier. I'm guessing the same is true on Linux, but wanted to confirm that. Thanks.,

Flags: needinfo?(jteh) → needinfo?(enrico)

(In reply to James Teh [:Jamie] from comment #6)

On Windows, doing this opens the Downloads window, which means the Windows key is being ignored somewhere instead of being treated as a modifier.

Ah. It looks like this is Windows specific. This was implemented because of bug 1100862.

See Also: → 1100862

(In reply to James Teh [:Jamie] from comment #6)

Hi Enrico. Assuming a default Firefox key binding of control+shift+y to open Downloads, what happens if you press control+shift+super+y? I can't test this myself on Linux because I'm using a Linux vm and the host keeps swallowing the Windows key. On Windows, doing this opens the Downloads window, which means the Windows key is being ignored somewhere instead of being treated as a modifier. I'm guessing the same is true on Linux, but wanted to confirm that. Thanks.,

James,
I've tested now on 2 Linux configurations (Fedora Gnome and Ubuntu Gnome)
The control+shift+y opens Downloads while control+shift+super+y has no effect

Enrico

Flags: needinfo?(enrico)

Hi James,

I've applied your proposed patch https://phabricator.services.mozilla.com/D290032 and tested it on Linux Fedora Asahi Remix on a MacBook Air device.

Now the command key is working and for example the keys are mapped as Win+Alt+Left Arrow
tested with a shortcut and it works :)

I think that the only minor inconvenience is the naming: for example I don't have a "Win" key on my hardware because I've for example [fn - control - option - command] written on the top left part of the keyboard (I'm using a macbook hardware)

I've checked and Gnome for shortcuts is using the word "Super" to cover that button in a generic way independent from the hardware

Anyway this part is minor and maybe related to another issue that I can create :)

The part related to the submitted bug is working well!

Enrico

Thanks for testing. Yeah, I was aware of the fact that it gets called "Win". Changing that has impacts beyond about:keyboard, so I'm going to need to look into that further and consult with others about that.

Assignee: nobody → jteh
Attachment #9558532 - Attachment description: WIP: Bug 2012218: about:keyboard: Support super/meta key on Linux. → Bug 2012218: about:keyboard: Support super/meta key on Linux. r?mossop
Status: UNCONFIRMED → ASSIGNED
Ever confirmed: true
Status: ASSIGNED → RESOLVED
Closed: 3 months ago
Resolution: --- → FIXED
Target Milestone: --- → 152 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: