Bug 444537 - when toggling keyboard layout, shortcuts continue to use the old layout
Summary: when toggling keyboard layout, shortcuts continue to use the old layout
Status: REPORTED
Alias: None
Product: frameworks-kglobalaccel
Classification: Frameworks and Libraries
Component: general (show other bugs)
Version: 6.0.0
Platform: Arch Linux Linux
: NOR normal
Target Milestone: ---
Assignee: kdelibs bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-10-28 12:13 UTC by Adam Fontenot
Modified: 2024-03-05 02:16 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Adam Fontenot 2021-10-28 12:13:51 UTC
SUMMARY
I use Dvorak and Qwerty layouts interchangeably. KDE ships with a bunch of shortcuts by default, for example opening Dolphin has the default shortcut Meta+E. When I log in to KDE with one layout set as default, then toggle to the other layout, shortcuts continue to use the original layout.

STEPS TO REPRODUCE
1. Set your input methods to include both Dvorak and Qwerty, with Dvorak set as default. Make sure the keyboard layout toggle widget is visible in your taskbar. Make sure Dolphin is set to open with the Meta+E shortcut (should be the default).
2. Reboot and log in.
3. Press Meta+E (because your keyboard layout is now Dvorak, that's the physical keys Meta+D on a standard US Qwerty keyboard).
4. Close Dolphin if it appears.
5. Toggle your keyboard layout to Qwerty.
6. Press Meta+D (same as the physical keys, because you're now using Qwerty)

OBSERVED RESULT
Dolphin appears both times.

EXPECTED RESULT
Dolphin should appear the first time, but not appear the second time. The keyboard shortcut has not changed (it's Meta+E), but you are now pressing the keys Meta+D. 

SOFTWARE/OS VERSIONS
Linux: Arch Linux x86_64 (kernel 5.14.14)
KDE Plasma Version: 5.23.2
KDE Frameworks Version: 5.87.0
Qt Version: 5.15.2

ADDITIONAL INFORMATION
I think this *might* be caused by the keyboard layout switcher not changing the layout configured via the X keyboard extension. When I switch to Qwerty, I still see the following:

$ setxkbmap -query
rules:      evdev
model:      pc101
layout:     dvorak,us

So probably X still thinks I'm using Dvorak, so maybe the keycodes that kglobalaccel sees are still the Dvorak keys. If that's the issue and this belongs in a different component, I'd appreciate someone helping me move it there.
Comment 1 Oded Arbel 2022-11-22 11:53:57 UTC
This X11 issue is probably a dup of bug 355046, as it is about the global keyboard shortcut being bound to the physical key instead of the input character (pressing META+D in Qwerty and META+E in Dvorak is the same physical key) - which BTW, as I noted in my comment in bug 355046, is the desired behavior.

I'm a bit troubled by something in this report - META+E is the default configuration for "open dolphin" and on my QWERTY system it is activating by holding META and pressing the third letter key from the left in the top letter row. This report seems to suggest that if you set the layout to Dvorak, and do nothing else, now Dolphin can be started by holding META and pressing the third letter key from the left in the second letter row - this seems counter intuitive, but I'm not currently running X11 so cannot test.
Comment 2 Adam Fontenot 2024-03-05 02:16:21 UTC
Reproduced on 6.0.0 under X11.

Not sure if the component could have changed, but in any case khotkeys is dead now, but global shortcuts for e.g. opening Dolphin are still present under "Shortcuts" in System Settings.