From 4b181b8125593f0cc3f80f63f1d269806c74295d Mon Sep 17 00:00:00 2001 From: Michael Orlitzky Date: Sun, 3 Dec 2023 12:28:06 -0500 Subject: [PATCH] src/xkb/symbols/emacs-keys: new xkb layout file --- src/xkb/symbols/emacs-keys | 39 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 src/xkb/symbols/emacs-keys 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 { }; +}; -- 2.43.2