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
508 stars 36 forks source link

Delay after pressing other keys #11

Closed BaseJumper1985 closed 5 years ago

BaseJumper1985 commented 5 years ago

I notice when using this that there is a small delay after pressing other keys before Esc is sent. I use Vim as my primary text/code editor, and I often find myself quickly pressing i for insert, a single key, then Caps Lock in quick succession. The problem is that the press of Caps Lock is missed every time.

Edit: If I slow down a little bit, this does not happen. Only when I am working quickly.

Thank you.

ililim commented 5 years ago

My guess of what's happening here is that when you press something like i, j, Caps in quick succession, you actually have bit of key overlap, triggering the flag in dual key remap that turns your caps key into control instead of escape. So what dual-key-remap sees looks like this: <j down> <caps down> <j up> <caps up>.

In this case dual-key-remap will still convert caps into the alternative key (ctrl in default config) as it detected key activity while the key was pressed down.

A potential solution for this would be to only trigger the "Other keys have been held down" flag on key down events as opposed to all events.

ililim commented 5 years ago

This has been implemented in the latest release (v0.4). In my testing the Esc key is no longer being swallowed with quick typing causes overlapping key inputs.