mirror of
https://github.com/alols/xcape.git
synced 2026-09-10 09:56:14 -04:00
Improve instructions for emulating space2ctrl in readme
In my old approach I bound space to a brand new keysym. This works well for most programs but not for emacs! The problem is that emacs tries to warn you when you press unbound keys, which causes slowdowns and odd behaviour. The solution is to instead bind space to some unused modifier key that will be recognised and ignored by emacs. I've found that "Hyper_L" works nicely.
This commit is contained in:
parent
82014c8436
commit
a58beb5569
22
README.md
22
README.md
|
|
@ -66,18 +66,20 @@ key name is found.
|
|||
(similar to [Space2ctrl](https://github.com/r0adrunner/Space2Ctrl))
|
||||
with the following sequence of commands.
|
||||
|
||||
# Map a new (currently non-existant) keysym to the spacebar's
|
||||
# keycode and make it a control modifier.
|
||||
xmodmap -e 'keycode 65 = 0x1234'
|
||||
xmodmap -e 'add control = 0x1234'
|
||||
# Map an unused modifier's keysym to the spacebar's keycode and make it a
|
||||
# control modifier. It needs to be an existing key so that emacs won't
|
||||
# spazz out when you press it. Hyper_L is a good candidate.
|
||||
spare_modifier="Hyper_L"
|
||||
xmodmap -e "keycode 65 = $spare_modifier"
|
||||
xmodmap -e "remove mod4 = $spare_modifier" # hyper_l is mod4 by default
|
||||
xmodmap -e "add Control = $spare_modifier"
|
||||
|
||||
# Map space to a new keycode which has no corresponding key (to
|
||||
# keep it around for xcape to use).
|
||||
xmodmap -e 'keycode any = space'
|
||||
# Map space to an unused keycode (to keep it around for xcape to
|
||||
# use).
|
||||
xmodmap -e "keycode any = space"
|
||||
|
||||
# Finally use xcape to cause our new keysym to generate a space
|
||||
# when tapped.
|
||||
./xcape -e '0x1234=space'
|
||||
# Finally use xcape to cause the space bar to generate a space when tapped.
|
||||
xcape_str=$xcape_str'#65=space;'
|
||||
|
||||
This is particularly useful for emacs users.
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue