Summary: | Caps Lock assigned to Last used shortcut still acts as a Caps Lock | ||
---|---|---|---|
Product: | [Plasma] kwin | Reporter: | Notare Alname <kdebugs> |
Component: | input | Assignee: | KWin default assignee <kwin-bugs-null> |
Status: | CONFIRMED --- | ||
Severity: | normal | CC: | akselmo, dev, dion, john.kizer, nate, valik4767, yanexbug |
Priority: | NOR | Keywords: | qt6, usability |
Version First Reported In: | 5.90.0 | ||
Target Milestone: | --- | ||
Platform: | Ubuntu | ||
OS: | Linux | ||
Latest Commit: | Version Fixed In: | ||
Sentry Crash Report: | |||
Attachments: | How related section of keyboard settings look now, for reference |
Description
Notare Alname
2023-12-07 12:40:01 UTC
Can confirm the bug on Plasma 6. If i set main shortcut to capslock, this doesnt happen, but with last used shortcut it does. I think this needs to be reported to upstream, since the XKB system is missing a rule for setting capslock non-toggling (acts like shift but doesnt remap to shift). I can disable capslock, but then the key does not work at all. Alternatively, XKB system could provide the "switch to last layout" option completely, and we could just use that like with layout switching. One can modify `/usr/share/X11/xkb/compat/caps` to make capslock work like shift, but I think there should be easier way to do this provided by upstream, and I don't feel comfortable making a special case for capslock that modifies the aforementioned file. Besides, modifying this file requires root permissions. Current workaround for anyone wishing to use capslock without it toggling capital letters: 1. Open `/usr/share/X11/xkb/compat/caps` 2. Change `LockMods` to `SetMods` 3. Log out and log back in Excellent investigation. Akseli, would you be willing to file that bug report upstream, given that you've investigated and root-caused the issue already? Yeah i can do that I've reported it here to upstream https://github.com/xkbcommon/libxkbcommon/issues/464 I am actually unsure if this is upstream bug after all. We need to see if there is already a way to disable capslock toggling from KDE framework/plasma/etc. side. If not, we probably need to ask for API implementation. See the linked github issue above. So, reading the issue linked below, XKB guys point at Plasma and Plasma points at XKB, but from what I see Plasma can actually do something about it. Maybe the issue needs reopening? User experience with 3+ layouts is quite irritating without this feature working alright. This cannot be implemented in XKB, because there is no support for “last *used* layout”. The issue seems to be that Plasma intercepts the keysym Caps_Lock but not its *action*. Plasma should probably handle this at a lower level, before the modifiers state is propagated. It still exists in Kubuntu KDE Plasma 6.1.5, so it blocks the feature for limiting the number of layouts for people who use Caps Lock to switch languages. No need to change the version field; please leave those alone. Thanks. As written above, this is Plasma bug, not an XKB one: the XKB action (locking Caps) is resolved while it should not, when Caps key is bound to a shortcut. In order to mitigate this, you may: 1. Use one of the XKB options to switch layouts. There are located in “Key bindings” (top right button from keyboard config), then look for the group “Switching to another layout”. The “Caps Lock” option in this group allow you to switch to cycle the layouts. But they are many other options which may fit better to your needs. 2. For power users: Tweak the XKB keymap by creating your own option. Follow the guide at: https://xkbcommon.org/doc/current/user-configuration.html#autotoc_md16: cat $XDG_CONFIG_HOME/xkb/rules/evdev ! option = symbols custom:caps = +my-caps ! include %S/evdev $ cat $XDG_CONFIG_HOME/xkb/symbols/my-caps partial alphanumeric_keys xkb_symbols "deactivate caps" { key <CAPS> { [ F35 ] }; }; and adapt the “Discoverable layouts” section of the linked example with the files above. Now re-open the keyboard settings and activate your brand new option: you should be able to bind the CapsLock *key* as described in this issue, *without* locking the Caps. It does not mess with systems files and it will survive an update of those. Note that I will not assist you further with tweaking XKB, so if you do not feel comfortable please stick with temp solution 1) and wait for the KDE devs to fix the issue. Wismill, thank you so much. The first option is not okay for me because it doesn't allow me to set Caps Lock to change between the last used layouts, so the spare layouts feature becomes useless. But the second one is the real solution. Also here is the content of xkb/rules/envdev.xml for someone to copy. You can find this option in the Key Bindings -> Miscellaneous options. ``` <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE xkbConfigRegistry SYSTEM "xkb.dtd"> <xkbConfigRegistry version="1.1"> <optionList> <group allowMultipleSelection="true"> <configItem> <name>custom</name> <description>Custom options</description> </configItem> <option> <configItem> <name>custom:my-caps</name> <description>Disable Caps Lock function</description> </configItem> </option> </group> </optionList> </xkbConfigRegistry> ``` Same thing happens when using "Caps Lock" to switch keyboard layout: layout is switched, but also caps lock is toggled. It's possible to workaround this by using "Key bindings" page and assign Caps Lock as layout switcher. But unfortunately there is no way to assign it to "switch to last used layout" Marking as Confirmed as I can reproduce the behavior described, thanks! |