I would like to make a new keyboard layout in Linux that moves the modifier keys around. The problem is that this needs to be an xkb layout, because I still need to be able to switch to the Qwerty layout and the layout of my native language. Is there a way to write an xkb layout that works on the keycodes instead of the symbols?
That is, instead of this type of entry:
key <LCTL> { [ Control_L ] };
I would use this type of entry (doesn't work, just an example):
key keycode37 { [ Control_L ] };
I could then do something like put the Shift key where Alt was and move Alt to where the Windows key was:
key keycode133 { [ Alt_L ] };
key keycode64 { [ Shift_L ] };
I stress that using xmodmap clear mod* is not a good solution because that would prevent me from using any other keyboard layouts with the modifier keys in their standard positions.