From: Michael Orlitzky Date: Sun, 3 Dec 2023 17:28:06 +0000 (-0500) Subject: src/xkb/symbols/emacs-keys: new xkb layout file X-Git-Url: https://gitweb.michael.orlitzky.com/?a=commitdiff_plain;h=4b181b8125593f0cc3f80f63f1d269806c74295d;p=emacs-keys.git src/xkb/symbols/emacs-keys: new xkb layout file --- diff --git a/src/xkb/symbols/emacs-keys b/src/xkb/symbols/emacs-keys new file mode 100644 index 0000000..3b9c532 --- /dev/null +++ b/src/xkb/symbols/emacs-keys @@ -0,0 +1,39 @@ +// +// The emacs-keys layout is a modified "us" layout: +// +// * CapsLock becomes Left-Alt +// * Left-Alt and Left-Ctrl are swapped +// * Right-Alt and Right-Ctrl are swapped +// +// This could probably be pieced together from various +// rules that ship with xkeyboard-config, but it's a +// lot nicer to have everything available as a layout. +// + +default partial alphanumeric_keys +xkb_symbols "emacs-keys" { + include "us(basic)" + name[Group1] = "Emacs Keys"; + + // Make capslock a left-alt. + replace key { [ Alt_L, Meta_L ] }; + modifier_map Mod1 { }; + + // This is a copy of the ctrl(swap_lalt_lctl) rule + // that ships with xkeyboard-config. + replace key { [ Control_L, Control_L ] }; + replace key { [ Alt_L, Meta_L ] }; + modifier_map Mod1 { }; + modifier_map Control { }; + replace key { [ Control_L, Control_L ] }; + replace key { [ Alt_L, Meta_L ] }; + modifier_map Mod1 { }; + modifier_map Control { }; + + // This is a copy of the ctrl(swap_ralt_rctl) rule + // that ships with xkeyboard-config. + replace key { [ Control_R, Control_R ] }; + replace key { [ Alt_R, Meta_R ] }; + modifier_map Mod1 { }; + modifier_map Control { }; +};