From cb898f2decdf92ff99b8202ada7f98a3a40b4bd6 Mon Sep 17 00:00:00 2001 From: Marty Oehme Date: Tue, 26 Feb 2019 12:38:19 +0100 Subject: [PATCH] Make capslock behave as control/escape key Behaves as control when used in conjunction with other keys. Behaves as escape when used alone. When accidentally pressed keep long pressing (>500ms) and it will pretend to not have been pressed. --- .config/zsh/5-caps-to-control | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 .config/zsh/5-caps-to-control diff --git a/.config/zsh/5-caps-to-control b/.config/zsh/5-caps-to-control new file mode 100644 index 0000000..e4d5d6d --- /dev/null +++ b/.config/zsh/5-caps-to-control @@ -0,0 +1,11 @@ +#!/bin/sh + +# Remaps Capslock key to control. +# (only works for x environment - I haven't needed it for non-x yet) +setxkbmap -option ctrl:nocaps + +# Makes Capslock behave as escape - when ONLY capslock is pressed and released +# this only works when we already substitute a ctrl for caps with the lines above, +# otherwise control itself will act as escape. +# Needs xcape package installed. https://github.com/alols/xcape +xcape -e 'Control_L=Escape'