0

I am using a device with a builtin keyboard and run ARM Debian on it with i3 as Window Manager. There is one Alt key (keysym Alt_L), and two keys for special characters that look similar to AltGr since they correspond to ISO_Level3_Shift according to xev:

KeyPress event, serial 34, synthetic NO, window 0x2200001,
    root 0x38c, subw 0x0, time 86851282, (270,736), root:(1903,793),
    state 0x0, keycode 64 (keysym 0xffe9, Alt_L), same_screen YES,
    XLookupString gives 0 bytes: 
    XmbLookupString gives 0 bytes: 
    XFilterEvent returns: False

KeyRelease event, serial 34, synthetic NO, window 0x2200001,
    root 0x38c, subw 0x0, time 86851413, (270,736), root:(1903,793),
    state 0x8, keycode 64 (keysym 0xffe9, Alt_L), same_screen YES,
    XLookupString gives 0 bytes: 
    XFilterEvent returns: False

KeyPress event, serial 34, synthetic NO, window 0x2200001,
    root 0x38c, subw 0x0, time 86854252, (270,736), root:(1903,793),
    state 0x0, keycode 108 (keysym 0xfe03, ISO_Level3_Shift), same_screen YES,
    XKeysymToKeycode returns keycode: 92
    XLookupString gives 0 bytes: 
    XmbLookupString gives 0 bytes: 
    XFilterEvent returns: False

KeyRelease event, serial 34, synthetic NO, window 0x2200001,
    root 0x38c, subw 0x0, time 86854362, (270,736), root:(1903,793),
    state 0x8, keycode 108 (keysym 0xfe03, ISO_Level3_Shift), same_screen YES,
    XKeysymToKeycode returns keycode: 92
    XLookupString gives 0 bytes: 
    XFilterEvent returns: False

Yet, despite different keysyms, all three keys are considered the same by Debian and i3 WM: regardless of the key I press, they all serve as the modifier key in i3 after I set $mod to Mod1 in my i3 config. I haven't found a way too make my system distinguish them.

Is there a way to separate the two keysims and keep Alt base function, i.e., make it open menus in GUI applications but not trigger i3 modifier? Or, alternatively, my preference would be to use Alt_L to reach third-level xkb symbols, and ISO_Level3_Shift as my i3 modifier; how could I do that?

0
0

I found the setxkbmap options that allowed me to assign the correct function to each keys in this gist.

So adding this in my i3 config worked to set the Alt key to ISO_Level3_Shift and my other modifier key (duplicated on both sides of the keyboard) to Super_R:

exec --no-startup-id setxkbmap -model fxtecpro1 -layout fxtec_vndr/pro1 -variant us2 -rules evdev -option lv3:lalt_switch, compose:caps, altwin:swap_alt_win

There are some other unrelated options in the command, either for personal taste or to comply with the peculiarities of my device. pro1 is a xkb file tailed to the device, and us2 is a custom us-intl variant.

However, despite the change, i3 still ignores the difference between the keys and they still all act as $mod when I set i3 to use Mod1. I believe this is because I use Xwayland, and even if xmodmap and xev report the correct settings, Xwayland probably does not take them into account. I guess Wayland alternatives would work for Xwayland, but I don't think I can have this level of customization using Wayland alternatives.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.