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

Timeout for a key event #29

Open jeremies opened 3 years ago

jeremies commented 3 years ago

It would be very great to implement this feature:

If you hold a key longer than a timeout specified at the config file or with a default value (e.g. 500 ms), dual-key-remap will not generate a key event.

See for example:

https://github.com/alols/xcape#-t-timeout-ms

ililim commented 3 years ago

This is a great suggestion! I'll give this is a shot with the next set of features I'm going to implement.

kriipke commented 2 years ago

this would be great!

dsmitran commented 1 year ago

this would be great!

I just tried dual-key-remap and find it really useful but I would need this feature.

I come from lydell/dual and use this feature.

ulixxe commented 1 year ago

Maybe you can check my repo: https://github.com/ulixxe/keyboard_remapper (check config.sample.txt).

igor-akhmetov commented 5 months ago

@ulixxe Hey, thanks for the fork! Would it be possible to rebase it on top of the latest dual-key-remap commits? I've got an issue with BigCtrl that it doesn't seem to correctly handle situations like "press K, press caps, release K, press S" which results in S pass-through instead of Ctrl-S, while dual-key-remap seems to handle this correctly.

ulixxe commented 5 months ago

Hi Igor, it is better if you open a new issue under BigCtrl. Anyway, what is your config.txt? When do you press S in above sequence?

igor-akhmetov commented 5 months ago

@ulixxe Issues seem to be disabled in BigCtrl, or am I misunderstanding something? About the sequence - sorry, I meant it to end with "press S". The config I tried is

remap_key=CAPSLOCK
when_alone=ESCAPE
with_other=CTRL
hold_delay=0
tap_timeout=500
doublepress_timeout=0

The debug output from BigCtrl is:

(input) KEY_K DOWN [scan:0x25 virt:0x4b flags:0x0 dwExtraInfo:0x0]
(input) CAPSLOCK DOWN [scan:0x3a virt:0x14 flags:0x0 dwExtraInfo:0x0]
(event) event_remapped_key_down
(input) KEY_K UP   [scan:0x25 virt:0x4b flags:0x80 dwExtraInfo:0x0]
(send) ESCAPE DOWN
(input) KEY_S DOWN [scan:0x1f virt:0x53 flags:0x0 dwExtraInfo:0x0]
(input) CAPSLOCK UP   [scan:0x3a virt:0x14 flags:0x80 dwExtraInfo:0x0]
(event) event_remapped_key_up
(input) KEY_S UP   [scan:0x1f virt:0x53 flags:0x80 dwExtraInfo:0x0]

Compared to the debug output from dual-key-remap:

(input) KEY_K DOWN [scan:0x25 virt:0x4b]
(input) CAPSLOCK DOWN [scan:0x3a virt:0x14]
(event) event_remapped_key_down
(input) KEY_K UP   [scan:0x25 virt:0x4b]
(send) CTRL DOWN
(input) KEY_S DOWN [scan:0x1f virt:0x53]
(input) CAPSLOCK UP   [scan:0x3a virt:0x14]
(event) event_remapped_key_up
(send) CTRL UP
(input) KEY_S UP   [scan:0x1f virt:0x53]

Thanks!

ulixxe commented 5 months ago

Hi Igor, the issue tab was not enabled on my fork. I enabled it and push the "wip" branch that maybe fix your issue. Pleas let me know it if fixes your issue.

igor-akhmetov commented 5 months ago

@ulixxe Seems like the issue is fixed, thanks a lot!