From ba4959af1d6367125d255ff48e0a4bfb6d4f0ab5 Mon Sep 17 00:00:00 2001 From: "R. Steve McKown" Date: Fri, 30 Jan 2015 21:27:19 -0700 Subject: [PATCH 1/1] Initial commit --- 90-evdev-CM-Storm.conf | 8 ++++++++ README | 18 ++++++++++++++++++ ctrlwin | 8 ++++++++ evdev.lst.patch | 11 +++++++++++ evdev.patch | 10 ++++++++++ 5 files changed, 55 insertions(+) create mode 100644 90-evdev-CM-Storm.conf create mode 100644 README create mode 100644 ctrlwin create mode 100644 evdev.lst.patch create mode 100644 evdev.patch diff --git a/90-evdev-CM-Storm.conf b/90-evdev-CM-Storm.conf new file mode 100644 index 0000000..c1b29e0 --- /dev/null +++ b/90-evdev-CM-Storm.conf @@ -0,0 +1,8 @@ +Section "InputClass" + Identifier "CM Storm keyboard" + MatchIsKeyboard "on" + MatchDevicePath "/dev/input/event*" + Driver "evdev" + MatchUSBID "2516:0017" + Option "XkbOptions" "ctrlwin:swap_ctrl_win" +EndSection diff --git a/README b/README new file mode 100644 index 0000000..4a1862b --- /dev/null +++ b/README @@ -0,0 +1,18 @@ +Provide a configuration for an external USB CM Storm keyboard that swaps the +Windows and Control keys automatically when the device is connected. + +Steps to install: + +1. sudo cp ctrlwin /usr/share/X11/xkb/symbols/ + sudo chmod 644 /usr/share/X11/xkb/symbols/ctrlwin + +2. sudo cp 90-evdev-CM-Storm.conf /usr/share/X11/xorg.conf.d/ + sudo chmod 644 /usr/share/X11/xorg.conf.d/90-evdev-CM-Storm.conf + +3. sudo -s + cd /usr/share/X11/xkb/rules + patch -p0 < evdev.patch + patch -p0 < evdev.lst.patch + +4. Logout and back in so Xorg will re-read the config files in + /usr/share/X11/xorg.conf.d diff --git a/ctrlwin b/ctrlwin new file mode 100644 index 0000000..b3467b6 --- /dev/null +++ b/ctrlwin @@ -0,0 +1,8 @@ +// Swap the Ctrl and Win keys. +partial modifier_keys +xkb_symbols "swap_ctrl_win" { + key { [ Control_L ] }; + key { [ Super_L ] }; + key { [ Control_R ] }; + key { [ Super_R ] }; +}; diff --git a/evdev.lst.patch b/evdev.lst.patch new file mode 100644 index 0000000..4d9bb9b --- /dev/null +++ b/evdev.lst.patch @@ -0,0 +1,11 @@ +--- evdev.lst.orig 2014-01-15 07:42:33.000000000 -0700 ++++ evdev.lst 2015-01-30 20:20:20.976390083 -0700 +@@ -800,6 +800,8 @@ + altwin:hyper_win Hyper is mapped to Win-keys + altwin:alt_super_win Alt is mapped to Right Win, Super to Menu + altwin:swap_alt_win Alt is swapped with Win ++ ctrlwin Ctrl/Win key behavior ++ ctrlwin:swap_ctrl_win Ctrl and Win keys are swapped + Compose key Position of Compose key + compose:ralt Right Alt + compose:lwin Left Win diff --git a/evdev.patch b/evdev.patch new file mode 100644 index 0000000..92f8ee0 --- /dev/null +++ b/evdev.patch @@ -0,0 +1,10 @@ +--- evdev.orig 2014-01-15 07:42:33.000000000 -0700 ++++ evdev 2015-01-30 20:20:08.708389769 -0700 +@@ -971,6 +971,7 @@ + altwin:hyper_win = +altwin(hyper_win) + altwin:alt_super_win = +altwin(alt_super_win) + altwin:swap_alt_win = +altwin(swap_alt_win) ++ ctrlwin:swap_ctrl_win = +ctrlwin(swap_ctrl_win) + grp:switch = +group(switch) + grp:lswitch = +group(lswitch) + grp:win_switch = +group(win_switch) -- 2.39.2