Open Bug 1611154 Opened 5 years ago Updated 21 days ago

Picture-in-Picture keyboard shortcut for international keyboards not available

Categories

(Toolkit :: Picture-in-Picture, defect, P3)

defect

Tracking

()

UNCONFIRMED

People

(Reporter: zazcallabah, Unassigned)

References

(Blocks 1 open bug)

Details

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

Steps to reproduce:

On my swedish keyboard with a swedish keyboard layout, what is the physical ]-key on a us layout is a "-key.

If I change to a us keyboard layout in the os, the pip-default keyboard shortcut works as it should despite the physical key having the wrong label, but with a swedish layout it does not. I'm guessing this is the same for any language layout that moves the relevant key.

Swedish layouts moves the ]-key to an alt-gr-shifted position on the 9-key, and I can not trigger pip by pressing ctrl-shift-altgr-9 either.

Anyway, steps to reproduce: On a dell precision 5530 laptop with a swedish physical keyboard variant, kubuntu 19.04, firefox 72.0.1, I opened a youtube video and pressed ctrl+shift+"

Actual results:

Nothing.

Expected results:

The picture-in-picture should activate.

Also it would be nice if the documentation could specify which key the magical ']' key is for those of us that have nordic keyboards for example.

Bugbug thinks this bug should belong to this component, but please revert this change in case of error.

Component: Untriaged → Video/Audio Controls
Product: Firefox → Toolkit

Hey Asa,

Here's a case where the keyboard shortcut we've selected for Picture-in-Picture doesn't work for a non-US keyboard. I know you probably have a bunch of other stuff on your plate, but I wonder if we should reconsider the current keyboard shortcut (which might also open up the possibility of exposing the shortcut on macOS).

Blocks: videopip
Priority: -- → P3
See Also: → 1599376

Perhaps we need a re-think on the keyboard shortcut. I'm curious why ctrl-shift-altgr-9 doesn't work though. Any ideas?

See Also: → 1642100

I can confirm this issue is still present on Firefox 88.0, Linux, Plasma(X11)

According to the US docs the combination is Ctrl-Shift-] or Ctrl-Shift-}, and according to the German docs the combination is exactly the same.

However, the ] key on my german keyboard is accessed via AltGr-9, and the } key is accessed via AltGr-0.

I have tried the following and none appear to work:

  • Ctrl-Shift-9 (or Ctrl-Shift-) )
  • Ctrl-Shift-0 (or Ctrl-Shift-=)
  • Ctrl-Shift-AltGr-9
  • Ctrl-Shift-AltGr-0

I have even tried the following with xdotool on my Firefox window:

  • xdotool key ctrl+shift+bracketright
  • xdotool key ctrl+shift+braceright

again with no effect.

I know that the above commands are valid because they have the effect of splitting my terminal window when I use them on the terminal.

Component: Video/Audio Controls → Picture-in-Picture
Version: 72 Branch → Trunk
Severity: normal → S3

Same issue with Belgian keyboards.

The problem why the AltGr combination doesn't work (at least on linux/unix?) might be because Shift+AltGr gives you the fourth level character.

E.g. AltGr+0 is } but Shift+AltGr+0 is ° (on my Belgian keyboard), so the system might see it as Ctrl+° instead of Ctrl+Shift+} ?

Same issue with Portuguese keyboard.

Same on the German Keyboard Layout, the Hotkey is impossible.

The latest Firefox v113 advertises this Hotkey in the latest version news.

From here:
https://www.mozilla.org/en-US/firefox/113.0/releasenotes/?utm_source=firefox-browser&utm_medium=firefox-desktop&utm_campaign=about-dialog
(picture-in-picture mode)

to here:
https://support.mozilla.org/de/kb/informationen-zum-bild-im-bild-modus-in-firefox

quoting german, explicitely mentioning the never-ever-working hotkey right now:

Tastenkombinationen
Verwenden Sie zum Aufrufen des Bild-im-Bild-Modus die Tastenkombinationen Strg + Umschalttaste + ]. Firefox wird versuchen, das relevanteste >Video auf dieser Seite in einem Bild-im-Bild-Fenster wiederzugeben. Ist das Bild-im-Bild-Fenster bereits geöffnet, wird es mit dieser >Tastenkombination geschlossen.

the issue is now 3 years and counting.
please reconsider the way you choose global hotkeys and keep in mind that international keyboard layouts are different from US-Layout and not all US hotkeys work on other layouts. (Though, this hotkey is not even working if choosing US keyboard layout!)

Either make working individual Hotkey-Layouts for other keyboard layouts or choose them wisely and use only those combinations that work on every keyboard-layout.
Ultimate Solution is that you set a working default hotkey-set, but also finally implement a method where users can change firefox' global default keyboard shortcuts (not only the addon-method that only works page-wise where addon-js is loaded).

It is Ctrl+Shift+9 for German (not with the numeric keypad).

(In reply to gilward.kukel from comment #9)

It is Ctrl+Shift+9 for German (not with the numeric keypad).

I just tried using "Strg+Umschalttaste+9" on a German keyboard while watching a Twitch stream and it did nothing.

(In reply to theone320 from comment #10)

I just tried using "Strg+Umschalttaste+9" on a German keyboard while watching a Twitch stream and it did nothing.

It works for me (German Firefox, German keyboard, German keyboard layout). It does not work when you change the UI language of Firefox to English (then it is Ctrl+Shift++ (Plus-key)).

(In reply to gilward.kukel from comment #11)

(In reply to theone320 from comment #10)

I just tried using "Strg+Umschalttaste+9" on a German keyboard while watching a Twitch stream and it did nothing.

It works for me (German Firefox, German keyboard, German keyboard layout). It does not work when you change the UI language of Firefox to English (then it is Ctrl+Shift++ (Plus-key)).

My OS language is English, my location is set to Germany and I am using a German keyboard. Firefox UI is set to English. Neither "Strg+Umschalttaste+'9'" nor "Strg+Umschalttaste+'+'" works for me.

Ctrl+Shift++ needs English keyboard layout.

(In reply to gilward.kukel from comment #13)

Ctrl+Shift++ needs English keyboard layout.

Okay, then I still want a way to use a hotkey for the setup I have. I do not want to change the keyboard layout.

(In reply to Asa Dotzler [:asa] from comment #3)

Perhaps we need a re-think on the keyboard shortcut. I'm curious why ctrl-shift-altgr-9 doesn't work though. Any ideas?

It's caused by Shift+AltGr being defined as the modifier combination for switching to the fourth layer in the default keymap for a lot of European keyboard layouts. This means that all keys that are usually typed by using AltGr (which are on the third layer) are not necessarily available for use alongside an extra Shift modifier.

A look at the relevant sections of the keymap

$ xkbcomp :0 my-keymap.xkb; cat my-keymap.xkb
...
xkb_types "complete" {

    virtual_modifiers NumLock,Alt,LevelThree,ScrollLock,LevelFive,AltGr,Meta,Super,Hyper;

...

    type "FOUR_LEVEL" {
        modifiers= Shift+LevelThree;
        map[Shift]= Level2;
        map[LevelThree]= Level3;
        map[Shift+LevelThree]= Level4;
        level_name[Level1]= "Base";
        level_name[Level2]= "Shift";
        level_name[Level3]= "Alt Base";
        level_name[Level4]= "Shift Alt";
    };

...

};

...

xkb_symbols "pc+se+us:2+inet(evdev)+ctrl(nocaps)" {

    name[group1]="Swedish";
    name[group2]="English (US)";

...

    key <AE09> {
        type[group1]= "FOUR_LEVEL",
        symbols[Group1]= [               9,      parenright,    bracketright,  guillemotright ],
        symbols[Group2]= [               9,       parenleft ]
    };

...

};

...

For reference, the XKB settings on my machine are as follows:

$ setxkbmap -print -verbose 10
Setting verbose level to 10
locale is C
Trying to load rules file ./rules/evdev...
Trying to load rules file /usr/share/X11/xkb/rules/evdev...
Success.
Applied rules from evdev:
rules:      evdev
model:      pc105
layout:     se,us
variant:    ,
options:    ctrl:nocaps
Trying to build keymap using the following components:
keycodes:   evdev+aliases(qwerty)
types:      complete
compat:     complete
symbols:    pc+se+us:2+inet(evdev)+ctrl(nocaps)
geometry:   pc(pc105)
xkb_keymap {
	xkb_keycodes  { include "evdev+aliases(qwerty)"	};
	xkb_types     { include "complete"	};
	xkb_compat    { include "complete"	};
	xkb_symbols   { include "pc+se+us:2+inet(evdev)+ctrl(nocaps)"	};
	xkb_geometry  { include "pc(pc105)"	};
};

Analysis

The symbol corresponding to Shift+AltGr+9 on my keyboard (se layout) is thus "guillemotright", i.e. ».

This means that the full keyboard shortcut Ctrl+Shift+AltGr+9 is interpreted as Ctrl+», instead of Ctrl+] as expected by Firefox.

Note that you can't really fix this by just changing the definition of the shortcut to be Ctrl+» in Firefox, since the way shortcuts are defined does not take into consideration the language of the keyboard layout (only the locale). More about this below. The layer four symbol on the 9 might also be something entirely different on non-Swedish keyboards, which would require yet another alias for this shortcut.

I suggest just changing it to a shortcut that uses fewer modifier keys and funky symbols (i.e. not Shift together with AltGr keys).

Workaround

A workaround is for us users to edit our keymaps (and load them when the X session starts, e.g. in .xinitrc):

$ xkbcomp :0 my-keymap.xkb
$ sed -i 's#symbols[Group1]= [               9,      parenright,    bracketright,  guillemotright ],#symbols[Group1]= [               9,      parenright,    bracketright,  bracketright ],#' my-keymap.xkb
$ xkbcomp my-keymap.xkb :0

This redefines the fourth layer for the 9 key so that Shift+AltGr+9 becomes just ]. Thus, Ctrl+Shift+AltGr+9 turns into Ctrl+].

Parting notes

Digging into this whole thing, I was a bit baffled to see that the modifiers of keyboard shortcuts are completely detached from the definition of the shortcut keys. The former is global and common to all keyboard layouts, whereas the latter is defined in the locale(!). There are many things that are problematic with this, as witnessed by this current bug report (no way to override the modifiers when they are causing issues), but also the fact that keyboard layout shouldn't have anything at all to do with the locale one is using. I'm using an English locale with my Swedish keyboard computer, for instance. I suppose Firefox carries a lot of historical baggage that causes things to be set up this way, but I still wanted to point it out.

Secondly, I think a lot of other Linux programs manage to use the actual keycodes for reading keyboard shortcuts, sidestepping this whole issue of what symbol corresponds to a suggested keyboard shortcut in various keymaps. I don't know enough X or Wayland programming to point you in the right direction for implementing this, however.

Duplicate of this bug: 1681807

Same problem with Spanish keyboard on GNU+Linux. I still don't understand why can't we just use Alt+P since it's not being used. It's been 5 years and no solution was provided.

You need to log in before you can comment on or make changes to this bug.