aahung / Unshaky

A software attempt to address the "double key press" issue on Apple's butterfly keyboard [not actively maintained]

Home Page:https://unshaky.nestederror.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Filtering sometimes doesn't work

sky417 opened this issue · comments

On macOS 11.5.2, unshaky 0.7.0.

Currently I have 55ms for global setting and 130ms for Space.

For some reason, the chattering doesn't get filtered for unknown reason. Here's a couple of samples:

1631548154.279290 Key( 40| 49|         Space|         0|130) E(10)
1631548154.396071 Key( 40| 49|         Space|         0|130) E(11)
1631548154.401034 Key( 40| 49|         Space|         0|130) E(10)
1631548154.404899 Key( 40| 49|         Space|         0|130) E(11)

The delta from keyup to keydown was only ~5ms, yet still registered.

1631548383.173862 Key( 40| 49|         Space|         0|130) E(10)
1631548383.231955 Key( 40| 14|             E|         0| 55) E(11)
1631548383.274003 Key( 40| 49|         Space|         0|130) E(11)
1631548383.278947 Key( 40| 49|         Space|         0|130) E(10)
1631548383.279698 Key( 40| 49|         Space|         0|130) E(11)

The delta here was about 4.9ms, and registered.

Working log:

1631548512.333682 Key( 40| 49|         Space|         0|130) E(11)
1631548512.342858 Key( 40| 49|         Space|         0|130) E(10) DISMISSED
1631548512.342986 Key( 40| 49|         Space|         0|130) E(11) DISMISSED

Worked fine in this case, ~9ms delta.

Is there any known issue ?

commented

@sky417 this is pretty strange. From the log, my guess is it is somehow triggers the special logic:

I cannot remember too much details. Will try to re-visit this when I have time

/** @ghost711: CMD+Space was pressed, which causes a duplicate pair of down/up
keyEvents to occur 1-5 msecs after the "real" pair of events.
- If the CMD key is released first, it will look like:
CMD+Space Down
Space Up
CMD+Space Down
CMD+Space Up
- Whereas if the space bar is released first, it will be:
CMD+Space Down
CMD+Space Up
CMD+Space Down
CMD+Space Up
- The issue only appears to happen with CMD+Space,
not CMD+<any other key>, or <any other modifier key>+Space.*/
// So here we allow one double-press to slip away

// let it slip away if allowance is 1 for CMD+SPACE