"Repeat assigned action" timer spuriously triggers when pressing a key quickly

Thank you for the amazing software!

Describe the bug

When "Repeat assigned action while pressing" is enabled for a keyboard shortcut, if you press (and release) the shortcut repeatedly very quickly, the repeater will trigger, even if you never hold the key down for the repeat delay duration consecutively.

In other words, if you press and release a shortcut many times rapidly, you will get duplicate actions.

(If I can speculate, I might guess that this is due to the code kicking off a timer when the shortcut is pressed with duration of repeat_delay, and when that timer expires, the code checks whether the key is still down. This doesn't take into account that the key may have been released between when the timer was started and when it expired, so the timer should have been killed, but it's not. But that's just my guess.)

To reproduce, create a keyboard shortcut for Option+C, and assign the action "c" (just insert the character "c"). Check the "Repeat assigned action" box. Set the Repeat Rate to ".01" and the Repeat Delay to ".3". If you focus a text field and repeatedly press and release Option+C (without holding down for more than .3 seconds at any time) you will get a bunch more actions triggered than you press the button.


Affected input device: Keyboard.


Device information:

  • Type of Mac: 2023 Macbook Pro
  • macOS version: Sonoma
  • BetterTouchTool version: 45730

Bump. Is any more information needed here?

bump!

I'll look into this soon, I think I can reproduce it. Unfortunately it's not just a timer

bump, just to keep this alive

bump :heart:

bumpity bump

I second this bug report and would love to see it fixed! My use case is I have ctrl + F bound to the right arrow. I frequently use this in PDFs to go to the next page. I like to use "Repeat assigned action while pressing" to cycle through numerous pages quickly and find it difficult to use when it starts repeating spuriously after I have pressed ctrl + F several times to cycle through a few pages. It seems that the action repetition logic should trigger based off the most recent key press, which would be similar to how MacOS handles other recurring actions (e.g., pressing the right arrow key a few times and then holding it to generate a recurring action).

1 Like

bumpo

no need to bump :wink: it’s on my todo list for the next stable release in ~3-4 weeks

1 Like

Awesome, thank you so much Andreas!

@Andreas_Hegenberg just checking in here!

Interesting. I've never noticed that before, but I can reproduce it.

You can try this as a kind of workaround:

  • Opt+C (short press), the letter “c” is typed when “c” is released. This works here, “c” is only typed once.

If this is also needed: “cccccc...” then:

  • Opt+C (long press with key repetition). “c” is typed when opt and "c" are held down.

Hopefully I have understood the problem correctly :slightly_smiling_face: