Sample Header Ad - 728x90

Swapping Ctrl, Win, and Alt in MX Linux (Xfce) – Issue with Alt Modifier

0 votes
1 answer
91 views
I'm using MX Linux with Xfce and trying to swap three keys: - Ctrl → Win (Super) - Win → Alt - Alt → Ctrl Swapping two keys at a time works using setxkbmap, for example:
setxkbmap -option ctrl:swap_lalt_lctl
However, if I try to add a second swap, like:
setxkbmap -option ctrl:swap_lalt_lctl,altwin:swap_alt_win
I end up with a repetition of the same key instead of a clean three-way swap. ### Attempted Solution I created a custom XKB symbols file:
xkb_symbols "ctrl_win_alt_swap" {
    include "us"  // Keep the default US layout
    key  { [ Super_L ] };  // Left Ctrl → Left Win
    key  { [ Alt_L ] };    // Left Win → Left Alt
    key  { [ Control_L ] }; // Left Alt → Left Ctrl
};
I apply this with:
setxkbmap -layout custom -variant ctrl_win_alt_swap
The remapping works, except for one issue: - Pressing **Alt alone** produces Ctrl, which is expected. - Pressing **Alt in combination with another key** results in **Ctrl+Alt**, instead of just Ctrl. Why does this happen, and how can I properly swap Ctrl, Win, and Alt without modifier conflicts?
Asked by igm2103 (1 rep)
Feb 2, 2025, 10:09 PM
Last activity: Feb 4, 2025, 06:36 PM