ililim / dual-key-remap

Remap any key to any other two keys on Windows 🔥. Remap CapsLock to both Ctrl and Escape! (It's like xcape for windows!)
GNU General Public License v2.0
499 stars 36 forks source link

Implements swapping alone and remapping key when held #33

Closed soraxas closed 2 years ago

soraxas commented 3 years ago

This PR adds an option alone_key_as_remap_when_held=[0|1] to the config file, where when enabled, it will maps the alone key back to the remapped key when the remapped key is being held.

i.e., say my config file is the default plus the new option

remap_key=CAPSLOCK
when_alone=ESCAPE
with_other=CTRL
alone_key_as_remap_when_held=1

when CAPSLOCK being pressed, pressing ESCAPE will be treated as if it is the key CAPSLOCK (both press and release event), without CTRL injection.

What this PR solves

There are some very rare occasions that CAPSLOCK will be turned on, despite having dual-key-remap.exe running (I'm not too sure how did that happen..., but it had happened to me a couple of times). When that happens, all typing became ALL CPAS and I have no way to turn capslock off due to the remapping. I have to find and kill dual-key-remap.exe through cmd or task manager, turn off capslock, and then navigate to the dual-key-remap folder and relaunch it. This PR enables a way to trigger the remapped key by using the target alone key.

ililim commented 3 years ago

This makes sense! I'm actually intending on solving this on an alternative way (a menu bar icon that can toggle dual-key-remap). That way the remapping API stays small and simple.

ililim commented 2 years ago

Not compatible with latest version, closing for now - feel free to open an issue to discuss this feature :)