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.
This commit is contained in:
parent
3d5389c8d4
commit
cb898f2dec
1 changed files with 11 additions and 0 deletions
11
.config/zsh/5-caps-to-control
Normal file
11
.config/zsh/5-caps-to-control
Normal file
|
@ -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'
|
Loading…
Reference in a new issue