"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:

If I'm understainding you correctly @Frank1, you're saying to create two shortcuts, one of which has the minimum press time + repeat, and one of which has no repeat, correct? If so, that's a nice workaround, but I'd still like a proper fix, because I have a lot of these shortcuts and it's a lot of work to create and maintain a large set of duplicate actions.

Of course, I understand that. But since I can't offer you a fix, I've offered you a workaround :slightly_smiling_face:

Edit: One last thought...

Put simply, there are two types of “small” developers.

The first group rarely adds new features to their product. They are content with fixing bugs or solving compatibility problems with new macos. The result is a solid but static app.

The second group is bubbling over with new ideas. New interesting features are constantly being added. The result is a unique and innovative product that is constantly being expanded. However, because many things are constantly being changed, bugs creep in again and again and sometimes remain for a long time.

Personally, I prefer the second group. But then you have to be able to live with tinkering with workarounds. Sometimes even a workaround of the workaround is necessary. I can live with that. But I could hardly live with a boring, static app.

Hi @Frank1 this is a nice workaround. One issue I am having is by assigning two shortcuts to the same key combination, BTT brings up a menu asking which shortcut I want to select when I press the combination.

For example, I have mapped ctrl+F to right arrow. Following your recommendation, one shortcut has no repeat and the second shortcut has a minimum hold time + repeat. Pressing ctrl+F brings up the following menu:

image

Is there any workaround for this issue? Have I implemented it incorrectly? Any insight would be appreciated. I'm happy for workarounds!

@Nomat To be on the safe side, I also tried ⌃+F and right arrow. It works as expected, at least here :slightly_smiling_face:

What you see above is the setup for “right arrow/cursor” with repeat when ⌃ and F are pressed and held.

If you don't want repetition, just press ⌃+F briefly. The action is triggered (once) when “F” is released.

It looks like this: ⌃+F

image

triggers this:

when the key is released

Could you check whether 4.723 (alpha, uploading now) fixes the issue?

//edit oops this seems to break repeat completely in some configurations. Will release an other alpha soon.

Ok I think 4.724 (alpha uploading now should work in all scenarios)

After the first tests, it seems to work well. No more jumps. My workaround is superfluous :slightly_smiling_face: