// Clear existing modifiers //default partial modifier_keys partial alphanumeric_keys xkb_symbols "basic" { include "us(basic)" // Define a custom modifier (Mode_switch) modifier_map Mod5 { }; // Remap Caps Lock to AltGr (ISO_Level3_Shift) and clear other modifiers key { type[Group1] = "ONE_LEVEL", symbols[Group1] = [ ISO_Level3_Shift ], actions[Group1] = [ SetMods(modifiers=Mod5) ] }; // Remap h, j, k, l to arrow keys when Mode_switch is active and clear other modifiers key { [ h, H, Left ] }; key { [ j, J, Down ] }; key { [ k, K, Up ] }; key { [ l, L, Right ] }; key { [ w, W, Up ] }; key { [ a, A, Left ] }; key { [ s, S, Down ] }; key { [ d, D, Right ] }; };