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

[BUG] Unstable keyboard layout switching #510

Open
Serg-VL opened this issue Jan 29, 2025 · 2 comments
Open

[BUG] Unstable keyboard layout switching #510

Serg-VL opened this issue Jan 29, 2025 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@Serg-VL
Copy link

Serg-VL commented Jan 29, 2025

Bare metal or virtual machine: Bare metal
(If in VM, which VM software): None

(Try running 'toshy-env' in a terminal to fill out the following fields...)

Linux distro name: Manjaro
Kernel Version: 6.12.4-1-MANJARO (64-bit)
Distro version: arch_btw
Distro variant: 
X11/Xorg or Wayland: Wayland 
Desktop environment(s): KDE Plasma
DE version(s): 6.2.4
WINDOW_MGR      = 'kwin_wayland'

Keyboard type (IBM, Chromebook, Windows, Apple): Apple Magic Keyboard (small, bluetooth)
Keyboard device name (try 'toshy-devices'):  /dev/input/event20   Magic Keyboard                      14:ac:60:29:65:04

Problem observed:
Sometimes stop reacting to hotkey control+space
Restores after I'm switching layout with alt+shift once
Frequently observed in electron apps (p3x-onenote-bin)

@Serg-VL Serg-VL added the bug Something isn't working label Jan 29, 2025
@RedBearAK
Copy link
Owner

@Serg-VL

I have often seen people having trouble with using the modifier-only Alt-Shift shortcut, particularly in KDE Plasma. But I'm not sure why that would affect Toshy's remaps for this for KDE, which are like this:

... (for terminals in KDE)
        ### Keyboard input source (language/layout) switching in KDE Plasma
        C("LC-Space"):              [bind,C("Super-Alt-L")],        # keyboard input source (layout) switching (Last-Used) (kde)
        C("Shift-LC-Space"):        [bind,C("Super-Alt-K")],        # keyboard input source (layout) switching (Next) (kde)
... (for non-terminals in KDE)
        ### Keyboard input source (language/layout) switching in KDE Plasma
        C("Super-Space"):          [bind,C("Super-Alt-L")],         # keyboard input source (layout) switching (Last-Used) (kde)
        C("Shift-Super-Space"):    [bind,C("Super-Alt-K")],         # keyboard input source (layout) switching (Next) (kde)

I would try disabling the Alt-Shift shortcut for input switching. But I don't actually have any idea whether that will make any difference.

I really have no idea what this could be about, and I doubt that anything meaningful would show up if you ran toshy-debug in a terminal and waited until this happened again. This feels like a bug in the Plasma shell shortcut code. What tends to happen in cases like this is the desktop shell starts ignoring one of the modifier keys in the shortcut, so the shortcut combo fails to invoke the expected action. The fact that using Alt-Shift fixes it really points to the Plasma shell being the problem. Like that jars something loose or resets the shell's interpretation of modifier key presses. The keymapper running the Toshy config should be doing the exact same thing before and after you used Alt-Shift to fix things.

But if you can find something that points to the keymapper being the problem, I'll try to look deeper into it.

If this happens again, try typing the native shortcut yourself before using Alt-Shift, to see if the native shortcut is even working. The physical keys while Toshy is enabled should be Ctrl-Win-L (on a PC keyboard with a Meta/Super/Win key) or Ctrl-Option-L (on an Apple keyboard). Those will logically be Super-Alt-L, which is the same as the shortcut you'll find in the Plasma Shortcuts settings module as Meta-Alt-L.

When the shortcut stops working, it would also be interesting to disable Toshy from the tray icon and then try to use the Plasma native shortcut Meta-Alt-L without the keymapper being involved. You should find that the native shortcut won't respond, until you do the Alt-Shift fix. This would be pretty conclusive proof that the problem has nothing to do with Toshy.

Obviously when Toshy is disabled, the physical keys will be back to normal, with Meta being either the Win key on a PC keyboard, or the Cmd key on an Apple keyboard, and then the Alt key will be the normal physical Alt key as labeled on the keyboard. Just to the left of the Space bar on a PC keyboard, or the Option/Alt key on an Apple keyboard.

Confused yet? Me too! 😆

@Serg-VL
Copy link
Author

Serg-VL commented Jan 30, 2025

Thank you!
Just hardly removed from KDE shortcut Alt-Shift. It wasn't ever configured :)
I always hated it, because it prevents search in mc :)

I'm staying waiting for any accidents.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants