houmain / keymapper

A cross-platform context-aware key remapper.
GNU General Public License v3.0
257 stars 21 forks source link

BUG: Unexpected behavior with chords + timeout mappings #113

Open arutonee1 opened 3 months ago

arutonee1 commented 3 months ago

Bug

Given a configuration like this:

Q{500ms} >> Virtual1^Virtual1

(Q W) >> A
(Q  ) >> B

the chord QW will result in ba if Q is pressed first, and just a only if Q is pressed second. The expected behavior is holding Q resulting in another layer until released, tapping Q resulting in b, and pressing QW (regardless of order) resulting in a.

Reproduction steps:

OS Details:

ristomatti commented 3 months ago

I ran across another timing issue related to virtual keys. With the below config, pressing F4{ShiftLeft} will block all input for 5s. Pressing ShiftLeft or F4{ShiftLeft} do not release the block either. I experimented with moving the 5000ms to various configurations but the end result seemed to be the same.

KeyLock = Virtual10

[default]
  F4{ShiftLeft}   >> KeyLock ^ 5000ms KeyLock

[modifier="KeyLock"]
  ShiftLeft     >> KeyLock ^
houmain commented 3 months ago

Hi, thanks for reporting! @arutonee1 this is indeed surprising, but conforms with the documented Functional principle. But I will see if I can fix it somehow.

@ristomatti currently timeouts in the output simply defer all subsequent output. So this is not a bug but expected behavior. You may want to create a feature request if you think that concurrently scheduled output would be important.

ristomatti commented 3 months ago

@houmain Thanks for the clarification. I'll consider it but I guess with #105 something like this could be done externally. Rather it was a bit unexpected since it completely blocked input.