From a6506a223f8aacdd604b221bd49be6c95ed9852f Mon Sep 17 00:00:00 2001 From: Vincent Bernat Date: Tue, 10 Jun 2014 20:59:47 +0200 Subject: [PATCH] keys: remove keyboard configuration from Lua code Everything is now handled by inputplug. --- bin/input-event | 7 +++++++ rc/start.lua | 20 -------------------- xkb/symbols/vbe | 9 +++++++++ xkb/x1.xkb | 19 +++++++++++++++++++ 4 files changed, 35 insertions(+), 20 deletions(-) create mode 100644 xkb/x1.xkb diff --git a/bin/input-event b/bin/input-event index 05f3da6..b626e49 100755 --- a/bin/input-event +++ b/bin/input-event @@ -18,6 +18,9 @@ xkb() { printf "$use: [%3d] $name\n" $device case "$use,$(uname -n),$name" in + XISlaveKeyboard,zoro,"AT Translated Set 2 keyboard") + xkb x1 + ;; XISlaveKeyboard,guybrush,"AT Translated Set 2 keyboard") xkb norwin ;; @@ -35,6 +38,10 @@ case "$use,$(uname -n),$name" in xinput set-prop $device 'Evdev Wheel Emulation Button' 2 xinput set-prop $device 'Evdev Wheel Emulation Axes' 6 7 4 5 ;; + XISlavePointer,zoro,"SynPS/2 Synaptics TouchPad") + xinput set-prop $device 'Synaptics Soft Button Areas' 3656 5112 0 2200 2928 3656 0 2200 + xinput set-prop $device 'Synaptics Area' 0 0 2200 0 + ;; XISlavePointer,guybrush,"SynPS/2 Synaptics TouchPad") xinput set-prop $device 'Synaptics Off' 1 ;; diff --git a/rc/start.lua b/rc/start.lua index 972a3ec..2c8cbb9 100644 --- a/rc/start.lua +++ b/rc/start.lua @@ -21,26 +21,6 @@ local execute = { "xdg-mime default gpicview.desktop image/png image/x-apple-ios-png image/jpeg image/jpg image/gif" } --- Keyboard/Mouse configuration -if config.hostname == "zoro" then - execute = awful.util.table.join( - execute, { - -- Keyboard and mouse - "setxkbmap us,fr '' compose:ralt grp:rctrl_rshift_toggle", - "xmodmap -e 'keycode 110 = Control_L'", -- home - "xmodmap -e 'keycode 115 = Control_L'", -- end - "xmodmap -e 'add control Control_L Control_R'", - "xmodmap -e 'keycode 49 = Insert", -- between alt_l and ctrl_l - "xmodmap -e 'keycode 9 = grave asciitilde'", -- escape - -- Wheel emulation - "xinput set-prop 'TPPS/2 IBM TrackPoint' 'Evdev Wheel Emulation' 1", - "xinput set-prop 'TPPS/2 IBM TrackPoint' 'Evdev Wheel Emulation Button' 2", - "xinput set-prop 'TPPS/2 IBM TrackPoint' 'Evdev Wheel Emulation Axes' 6 7 4 5", - -- Make touchpad buttons work - "xinput set-prop 'SynPS/2 Synaptics TouchPad' 'Synaptics Soft Button Areas' 3656 5112 0 2200 2928 3656 0 2200", - "xinput set-prop 'SynPS/2 Synaptics TouchPad' 'Synaptics Area' 0 0 2200 0"}) -end - os.execute(table.concat(execute, ";")) -- Spawn various X programs diff --git a/xkb/symbols/vbe b/xkb/symbols/vbe index 5708657..1a0a5a8 100644 --- a/xkb/symbols/vbe +++ b/xkb/symbols/vbe @@ -11,3 +11,12 @@ xkb_symbols "webcam" { [ XF86ScreenSaver, NoSymbol ] }; }; + +partial +xkb_symbols "x1" { + replace key { [ Control_L, Control_L ] }; + replace key { [ Control_L, Control_L ] }; + modifier map Control { Control_L, , }; + replace key { [ Insert ] }; + replace key { [ grave, asciitilde, dead_grave, dead_tilde ] }; +}; diff --git a/xkb/x1.xkb b/xkb/x1.xkb new file mode 100644 index 0000000..8c01022 --- /dev/null +++ b/xkb/x1.xkb @@ -0,0 +1,19 @@ +# -*- conf -*- + +# Configuration for a Lenovo X1 Carbon Gen 2 keyboard +# +# This keyboard is a mess. Really. Here is what we do about it: +# +# - transform Home and End as a Control_L key +# - transform Backquote (between left alt and left ctrl) into Insert +# - transform Escape to Backquote. Let's say we don't need escape. +# +# Escape can be replaced with C-[. See: +# http://vim.wikia.com/wiki/Avoid_the_escape_key +xkb_keymap { + xkb_keycodes { include "evdev+aliases(qwerty)" }; + xkb_types { include "complete" }; + xkb_compat { include "complete" }; + xkb_symbols { include "pc+us+fr:2+inet(evdev)+compose(ralt)+ctrl(nocaps)+group(rctrl_rshift_toggle)+vbe(x1)" }; + xkb_geometry { include "pc(pc105)" }; +};