Summary: | Main keyboard layout switching shortcuts fire on press instead of on release | ||
---|---|---|---|
Product: | [Plasma] kwin | Reporter: | Oded Arbel <oded> |
Component: | input | Assignee: | KWin default assignee <kwin-bugs-null> |
Status: | RESOLVED UPSTREAM | ||
Severity: | normal | CC: | beatloman91, butirsky, cravchik |
Priority: | NOR | ||
Version: | 5.27.5 | ||
Target Milestone: | --- | ||
Platform: | Other | ||
OS: | Linux | ||
URL: | https://github.com/xkbcommon/libxkbcommon/issues/92 | ||
See Also: |
https://bugs.kde.org/show_bug.cgi?id=464805 https://bugs.kde.org/show_bug.cgi?id=470257 https://bugs.kde.org/show_bug.cgi?id=470256 |
||
Latest Commit: | Version Fixed In: | ||
Sentry Crash Report: |
Description
Oded Arbel
2023-05-22 09:52:14 UTC
I corrected the summary to reflect what is the real problem on Plasma side. Please confirm. (In reply to Andrey from comment #1) > I corrected the summary to reflect what is the real problem on Plasma side. > Please confirm. This is not about the kwin "modifier only shortcut" feature. This is about the implementation of the KXB-like "shortcuts to switch layouts" implementation, which I'm not sure where exactly it is, but I'm close to 100% sure it isn't using the '[ModifierOnlyShortuts]' configuration in kwin. The current implementation definitely works with more than one modifier - I just chose the example of "Left Ctrl" as the "worst possible but still possible" example, but more common configurations are Ctrl+Shift and Alt+Shift. Also the actual problem isn't the "only one" behavior but the "on press instead of on release" behavior (which is also a problem with the '[ModifierOnlyShortuts]' configuration but as I mentioned above - likely a different similar problem). (In reply to Oded Arbel from comment #2) > This is not about the kwin "modifier only shortcut" feature. This is about > the implementation of the KXB-like "shortcuts to switch layouts" > implementation, which I'm not sure where exactly it is, but I'm close to > 100% sure it isn't using the '[ModifierOnlyShortuts]' configuration in kwin. There is no such implementation in KWin - there is XKB behavior support via libxkbcommon and native Plasma's global shortcuts implementation (accessible via Alternative shortcuts in Keyboard KCM), which can also include modifiers-only shortcuts. That is why I think it's actually about "modifier only shortcut" feature. Please check all of that. > > The current implementation definitely works with more than one modifier - I > just chose the example of "Left Ctrl" as the "worst possible but still > possible" example, but more common configurations are Ctrl+Shift and > Alt+Shift. Also the actual problem isn't the "only one" behavior but the "on > press instead of on release" behavior (which is also a problem with the > '[ModifierOnlyShortuts]' configuration but as I mentioned above - likely a > different similar problem). I assumed ModifierOnlyShortuts trigger on release, if not - please file a separate report. (In reply to Andrey from comment #3) > (In reply to Oded Arbel from comment #2) > > This is about the implementation of the KXB-like "shortcuts to switch layouts" implementation > There is no such implementation in KWin - there is XKB behavior support via > libxkbcommon Ok, so we're back to libxkbcommon's bug 92 - https://github.com/xkbcommon/libxkbcommon/issues/92 - which I see you picked up on 👍👍✌️ > and native Plasma's global shortcuts implementation (accessible > via Alternative shortcuts in Keyboard KCM), which can also include > modifiers-only shortcuts. It does not, and even it it did - it wouldn't work to solve the problem, both because of the "only one modifier" requirement, and because it uses logical keys and not hardware key codes, so it doesn't distinguish between left and right Ctrl, Alt vs AltGr, etc, which layout switching sometimes rely on (check, for example, "left ctrl for first layout, right ctrl for second layout"). > I assumed ModifierOnlyShortuts trigger on release, if not - please file a > separate report. I will. (In reply to Oded Arbel from comment #4) > (In reply to Andrey from comment #3) > > and native Plasma's global shortcuts implementation (accessible > > via Alternative shortcuts in Keyboard KCM), which can also include > > modifiers-only shortcuts. > > It does not, and even it it did - it wouldn't work to solve the problem, > both because of the "only one modifier" requirement, and because it uses > logical keys and not hardware key codes, so it doesn't distinguish between > left and right Ctrl, Alt vs AltGr, etc, which layout switching sometimes > rely on (check, for example, "left ctrl for first layout, right ctrl for > second layout"). > Please report it too > > I assumed ModifierOnlyShortuts trigger on release, if not - please file a > > separate report. > > I will. Please note bug 464805 wasn't confirmed on Wayland, so check it too. I verified that #464805 is indeed still an issue on Wayland and created tickets #470256 and #470257 Can you check if bug 464805 is still there if you register she modifier-only shortcut through special config file? (In reply to Andrey from comment #7) > Can you check if bug 464805 is still there if you register she modifier-only > shortcut through special config file? Setting up modifier-only shortcuts using kwinrc ([ModifierOnlyShortcuts] section), instead of using the System Settings shortcuts KCM, the modifier-only shortcut does trigger correctly on release. Nice, so temporary solution for you would be setting up the modifiers-only shortcut switching the layout through the config file. I would be appreciate if you investigate it yourself fist, but if you need my assistant please ask. Hint: basically, you would have to configure sending appropriate DBus call switching the layout I can get it to work (for some values of "work") by adding this to ~/.config/kwinrc: [ModifierOnlyShortcuts] Control=org.kde.keyboard,/Layouts,,switchToNextLayout Then if I disable the kxbcommon group switch shortcut, I can still switch shortcuts by hitting CTRL and releasing (and it doesn't take effect if I use a CTRL prefix on a shortcut, like CTRL+S). So.. well... I will try to live with this for a while - but it isn't a solution for people that still want to use "MS-Windows-like" shortcuts or have more complex setups. Some of that can be helped by implementing something like my suggestion in https://bugs.kde.org/show_bug.cgi?id=470256#c1, and obviously this needs to be figure out into the shortcut KCM (and not what it currently does, aka bug #464805) and the Keyboard KCM (bug #470257). Ok, while writing this up I figured where the "only CTRL on release" layout switcher trips me up - I often hold CTRL while thinking about the next I do - for example, I expect to want to CTRL+Tab next, so I hold CTRL while finishing reading, at which point I might not want to CTRL+Tab and release CTRL causing a layout switch. Using another single modifier won't help (there aren't enough anyway: ALT triggers menus in various apps, SHIFT suffers from the same problem that I often just hold it down for a bit, and META is already used for Kickoff). I will try to get used to that, but multi-modifier-only shortcuts should definitely be a thing that Plasma supports, if we want to dump xkbcommon. Still a progress) Thank you. *** Bug 477508 has been marked as a duplicate of this bug. *** |