You are not logged in.
As the name suggests, it should switch the layout when you press Left Shift + Left Alt, but it also switches the layout under other circumstances, namely when you press Right Alt + Left Shift or Right Shift + Left Alt.
The lalt_lshift_toggle option is defined in /usr/share/X11/xkb/symbols/group.
partial modifier_keys
xkb_symbols "lalt_lshift_toggle" {
key <LALT> {[ NoSymbol, ISO_Next_Group ], type[group1] = "TWO_LEVEL" };
key <LFSH> {[ Shift_L, ISO_Next_Group ], type[group1] = "PC_ALT_LEVEL2" };
};So my guess is that Right Shift and Right Alt switch the level to the second one, which is why the result is ISO_Next_Group, but I don't know how to prevent this behavior.
Here is the result of "setxkbmap -print -verbose 10":
Setting verbose level to 10
WARNING: Running setxkbmap against an Xwayland server
locale is C
Trying to load rules file ./rules/evdev...
Trying to load rules file /usr/share/X11/xkb/rules/evdev...
Success.
Applied rules from evdev:
rules: evdev
model: pc105
layout: us
Trying to build keymap using the following components:
keycodes: evdev+aliases(qwerty)
types: complete
compat: complete
symbols: pc+us+inet(evdev)
geometry: pc(pc105)
xkb_keymap {
xkb_keycodes { include "evdev+aliases(qwerty)" };
xkb_types { include "complete" };
xkb_compat { include "complete" };
xkb_symbols { include "pc+us+inet(evdev)" };
xkb_geometry { include "pc(pc105)" };
};Thanks in advance.
Offline
WARNING: Running setxkbmap against an Xwayland server
setxkbmap has limited meaning on wayland and there's no group switch configured for xwayland at all
Where and how do you set " grp:lalt_lshift_toggle" and what wayland compositor is this specfically?
Offline
I'm using Hyprland; therefore, XKB's options are set in hyprland.conf:
input {
kb_layout = us, ru
kb_options = grp:lalt_lshift_toggle
}Offline
Test the behavior w/ an X11 session (ie. i3 or openbox will do) and then check "wev" on hyprland to make sure the keys generate different input.
I suspect a https://github.com/hyprwm/Hyprland/issues for operating on the modifiers rather than the keycode and whatever finger you use to press alt: it's still the same *modifier*
Offline
WARNING: Running setxkbmap against an Xwayland server
setxkbmap -printand
setxkbmap -querydo not work on Wayland: you will always get the same output, unless you previously used
setxkbmapto set a keymap. You should use the libxkbcommon-tools package whenever dealing with XKB on Wayland, although currently there is no similar API.
The issue here is that the
grp:lalt_lshift_toggleoption adds a Shift level to the left Alt and an Alt level to the left Shift. These levels are activated by whatever Shift/Alt you have, not specifically the left ones.
There is unfortunately no easy workaround it, unless you are willing to edit advanced XKB features that work only on Wayland: make the left Alt and Shift triggers an additional virtual modifier
MyMod, create key types that mimic
TWO_LEVELand
PC_ALT_LEVEL2but using
MyModfor the second level, and update replace the option. Note that you should put your custom files in
~/.config/xkb.
Offline
I see. Thank you for detailed answer.
Offline