Add timeout for mapping control to escape

After holding capslock for 500ms, it will not generate an escape press
to avoid some unintentional presses of escape.
This commit is contained in:
Marty Oehme 2019-11-21 12:14:31 +01:00
parent 131e8e212a
commit 6b7e5d119f

View file

@ -49,7 +49,8 @@ setxkbmap -option grp:alt_shift_toggle
# this only works when we already substitute a ctrl for caps with the lines above, # this only works when we already substitute a ctrl for caps with the lines above,
# otherwise control itself will act as escape. # otherwise control itself will act as escape.
# Needs xcape package installed. https://github.com/alols/xcape # Needs xcape package installed. https://github.com/alols/xcape
type xcape >/dev/null 2>&1 && xcape -e 'Control_L=Escape' # set a timeout of 500ms, if pressed longer it will ignore esc
type xcape >/dev/null 2>&1 && xcape -e 'Control_L=Escape' -t 500
# if unclutter exists start it # if unclutter exists start it
type unclutter >/dev/null 2>&1 && unclutter & type unclutter >/dev/null 2>&1 && unclutter &