Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

keyboard layout change to CTRL-Shift/ALT-Shift breaks other shortcuts starting with CTRL-Shift/ALT-Shift #420

Open
ezhan opened this issue Dec 13, 2023 · 18 comments
Labels
help wanted Indicates that a maintainer wants help on an issue or pull request state Indicates a need for improvements or additions to the xkb_state API

Comments

@ezhan
Copy link

ezhan commented Dec 13, 2023

Trying to move from Windows to Linux & KDE (Gnome is affected as well). Found a ground braking misbehavior, making the move for me impossible. I used to change layouts with CTRL-Shift on Windows for 30 years as many other users.

Many multi language users suffers from this issue.

STEPS TO REPRODUCE

  1. Add keyboard layouts: English, Estonian, Russian (it should work with only two added languages, but I have three of them)
  2. Set keyboard language switcher to CTRL-Shift

Try to:
a) in Firefox close a tab and reopen it with CTRL-Shift-T shortcut
b) in Konsole try to copy a text with CTRL-Shift-C shortcut
c) any CTRL-Shift-X combinations in any program that supports any of such shortcuts

OBSERVED RESULT
a) opens a new tab
b) sends CTRL-C to terminate a command
c) any CTRL-Shift-X will not work

EXPECTED RESULT
a) reopens a closed tab
b) copies selected text
c) shortcuts works as designed by the program

THE PROBLEM ROOT
Pressing CTRL-Shift immediately changes the language, so the pressed letter does not do anything. Why? Of XBD standard. XBM triggers on pressing of a button, not on a release.

More information:
A 20 years old bug for X11: https://bugs.freedesktop.org/show_bug.cgi?id=865
KDE discussion: https://bugs.kde.org/show_bug.cgi?id=383113

There is a patched X11 available, but since all moves to Wayland, it is not an option anymore:
https://www.shellhacks.com/ctrl-shift-key-not-working-ubuntu-linux-mint/


EDIT 2024-06-17:

Now I have the exact guide to workaround this problem in KDE 6.1 and newer (release is scheduled for next week, 18.06.2024).

  1. Open Settings -> Keyboard -> Layouts
  2. Delete the assigned MAIN shortcut (CTRL-Shift or ALT-Shift), you may have to uncheck it in "Key Bindings" and apply.
  3. Assign Ctrl+Shift as ALTERNATIVE shortcut and apply.

Now it works as desired!

@ezhan ezhan changed the title keyboard layout change to CTRL-Shift shortcut brakes other shortcuts keyboard layout change to CTRL-Shift/ALT-Shift brakes other shortcuts starting with CTRL-Shift/ALT-Shift Dec 19, 2023
@ezhan
Copy link
Author

ezhan commented Dec 19, 2023

Not only CTRL-Shift+ are affected, ALT-Shift+ as well, when ALT-Shift is set to changing layout.

@ezhan
Copy link
Author

ezhan commented Dec 25, 2023

Can add, that CTRL-Shift-cursor key selection does not work as well - selection does not happens.

@ezhan
Copy link
Author

ezhan commented Dec 26, 2023

  1. Thank you for your work! I will install it on our warehouse PC with Ubuntu & Xorg.

  2. I personally decided to go with Fedora, as it is a semi-rolling updates distribution. Ubuntu, even not LTS still has no KDE 5.27.8, when 5.27.10 is available. But this is not about this bug.

  3. Your patch is for xorg, but now all are going to Wayland (Fedora already defaults to it)...

@diminDDL
Copy link

diminDDL commented Dec 27, 2023

+1 on this,one, the patch works well, but is not an option for wayland and or non ubuntu users. This is clearly a bug that needs to be addressed at the source and not be patched by third parties.

@shattl
Copy link

shattl commented Jan 13, 2024

+1 on this, really need to fix not by end-users

@ezhan
Copy link
Author

ezhan commented Feb 5, 2024

Since here is no activity of the developers/maintainers, I have sent an e-mail. Hope it will help get some love here.

If someone knows an other way to get attention please do it.


TO: [email protected], [email protected], [email protected]
SUBJ: issue 420 - keyboard layout change to CTRL-Shift/ALT-Shift brakes other shortcuts starting with CTRL-Shift/ALT-Shift

Hello.

Sorry to bother directly, but this is a deal breaker for many multi layout users
and the bug has no developer/maintainer activity.

100% of Windows users defaults to CTRL- or ATL-Shift for changing keyboard layout.

In Linux there is a huge problem with that combinations, since it breaks all CTRL- or ATL-Shift+
shortcuts in programs. Please read explanation here:
#420

KDE/Gnome refused to deal with it directly, since it is managed by XKB and should be fixed here.

Tnx.

@wismill
Copy link
Member

wismill commented Feb 15, 2024

Duplicate of #92. As written in various places, this is not a bug per se, but rather a limitation of the XKB protocol. I recognize it is equally annoying for the end user. We are aware of it, but you should understand that this is tricky to fix while maintaining perfect backward compatibility, on top of that with scarce manpower.

There are temporary solutions:

  • Use another key combination;
  • Use software like Keyd, Kanata, KMonad, etc. to emulate this behavior.

Please:

  • Read the discussion in Layout toggle prevents shortcuts from going through #92 before commenting here.
  • Do not add further comments about XOrg patches, they do not apply to our project.
  • Do not add further comments to show the interest or demand action. I am leaving the current issue open to show we care.

Thank you for your understanding.

@wismill wismill added the help wanted Indicates that a maintainer wants help on an issue or pull request label Feb 15, 2024
@ezhan
Copy link
Author

ezhan commented Mar 9, 2024

  1. I want to contribute 100 € for the fix (to person or project).

  2. We really have to start by something. For me sounds reasonable the proposal of making an alternative version and let all wanting this fixed to install it, test it out and report if any change to "do on release" behavior breaks backward compatibility or makes any other issues.

@Nixellion
Copy link

I would also be willing to donate money for this fix if someone makes a fund or just links a donation link. This is honestly quite a dumb small annoying issue, but it's one of many similar small quirks that Linux has which make it feel less polished and buggy for majority of Windows\MacOS users. It's also astonishing that this has been an issue for decade(s) without a fix.

@sergio-nsk
Copy link

sergio-nsk commented Apr 26, 2024

@wismill

to fix while maintaining perfect backward compatibility

What a backward compatibility are you talking about? Nobody uses the Ctrl+Shift and Alt+Shift as complete combinations because they break the continued combinations Ctrl+Shift+<Key> and Alt+Shift+<Key>. The Ctrl+Shift and Alt+Shift should be considered complete on key up, not key down.

@ezhan ezhan changed the title keyboard layout change to CTRL-Shift/ALT-Shift brakes other shortcuts starting with CTRL-Shift/ALT-Shift keyboard layout change to CTRL-Shift/ALT-Shift breaks other shortcuts starting with CTRL-Shift/ALT-Shift Apr 28, 2024
@xkbcommon xkbcommon deleted a comment from Zer0C00I Apr 28, 2024
@koread
Copy link

koread commented Apr 30, 2024

Thanks to the author for opening the discussion. I also join the request to pay attention to this situation.

On Windows, I have been using the Ctrl+Shift combination to change layouts for decades. In Linux (no matter what distribution) I choose the same combination, but then some combinations in applications stop working, for example:
Ctrl+Shift+T in Firefox (cancel closing a tab)
Ctrl+Shift+M (and others) in Telegram (text formatting)

I tried other combinations to change the layout (including Capslock), but could not get used to it. I have to give up shortcuts in applications and spend time calling up the context menu.

Please someone find a solution that works for both parties. I'm not asking you to change the behavior globally, just the ability to change it for an ordinary user (for example, by editing configuration files)

@ezhan
Copy link
Author

ezhan commented May 10, 2024

@xkbcommon, @wismill do you have any idea how we can go further? Where or whom to write, bet, ask?

@dmitry-azaraev
Copy link

The Ctrl+Shift and Alt+Shift should be considered complete on key up, not key down.

I guess it is already clear, but just want explicitly state: shortcuts on modifier keys like Alt+Shift should be considered complete on key up AND in absense any other keystrokes in-between. E.g. pressing Alt+Shift+Something might trigger something in apps, but should never switch layout, not on keydown nor on keyup. This logic is so natural... Is similar to mouse click on button requires mousedown over button, and mouse up over same button, no matter how long you press and how long you move out and in back.

@treapster
Copy link

Duplicate of #92. As written in various places, this is not a bug per se, but rather a limitation of the XKB protocol. I recognize it is equally annoying for the end user. We are aware of it, but you should understand that this is tricky to fix while maintaining perfect backward compatibility, on top of that with scarce manpower.

It is not a limitation, it is a buggy specification. But i don't understand why it is used as an excuse not to fix it. Why do you want to maintain compatibility with something that was broken from the start, annoys everyone and no one really likes? There is 20 year old thread of people complaining about it over 200+ comments, not a single one of them said "wait but i rely on current behavior!". Every user coming from Windows or macOS will be bitten by this bug, why do you suppose that fixing it will be more harmful than letting it ruin everyone's workflow? It doesn't make sense for me, as well as for other people affected, and there are hundreds of them(check the like counter on the issue).

@ezhan
Copy link
Author

ezhan commented Jun 5, 2024

The main problem is no one is working on this, even to make a version users can install and test out... :(

@treapster
Copy link

The lack of manpower is less of an issue if maintainers are willing to accept a patch

@xkbcommon xkbcommon locked as too heated and limited conversation to collaborators Jun 5, 2024
@wismill
Copy link
Member

wismill commented Jun 5, 2024

Locking, because the comments are not constructive. Please read my comment on this topic.

Please do not contribute to make maintaining this library a more thankless job than it is already.

@wismill
Copy link
Member

wismill commented Jun 5, 2024

It seems my comment on compatibility was misunderstood. I meant that the XKB protocol is what it is – for better or worse – and hacking against the protocol might introduce very tricky bugs, breaking compatibility of other features.

I did experiment a more general solution, but it is not clear how to make it backward-compatible. So… progress is slooow.

The lack of manpower is less of an issue if maintainers are willing to accept a patch

@treapster we do accept patches. Except none has been sent for this issue.

@wismill wismill added the state Indicates a need for improvements or additions to the xkb_state API label Jul 12, 2024
@xkbcommon xkbcommon unlocked this conversation Oct 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Indicates that a maintainer wants help on an issue or pull request state Indicates a need for improvements or additions to the xkb_state API
Projects
None yet
Development

No branches or pull requests

9 participants