Mouse clicks and key presses occasionally delayed or skipped

Describe the bug

All clicks and keypresses are delayed/skipped.

When running Restart BTT from the menu bar, input freezes for about 3 seconds. This is the same behavior that happens irregularly later.

Device information:

  • Type of Mac: MacBook Pro 16
  • macOS version: 11.2.1
  • BetterTouchTool version: 3.558

Additional information (e.g. StackTraces, related issues, screenshots, workarounds, etc.):

My best guess is that something is blocking the Cocoa HID event loop.

If you have any of the experimental sync options enabled in BTT, try to disable them.

Does any process on your system use a VERY high amount of CPU?

No high cpu. No experimental sync.

Is there anything I can do to debug it?

I can reliably reproduce, just need to find a way to sample the process at the right time.

problem is that it’s most likely not caused by BTT itself, thus sampling BTT might not result in useful information. You can still try it.

To create a sample you can use this terminal command:

sample BetterTouchTool -file ~/Desktop/BetterTouchToolSample.txt

Do you have any other mouse/keyboard/trackpad related app that could conflict with BTT?

Hammerspoon. But I disabled it and can still reproduce the problem.

Why I think it’s BTT is that as soon as I restart it from the menu bar, clicks aren’t received for 3 seconds. It must be something in the hid event loop.

the event loop works differently, but it can be a problem in one of the event taps.

It happens if the system is unable to deliver the events in time. This is if one or multiple tapping processes are taking too long to process events, however BTT usually is pretty fast unless some conflict with other tapping apps happen or the system is under very heavy load. Unfortunately this stuff is really hard to debug.

Possibly try whether it also happens with an empty BTT preset