When using setButtonCallback in the macOS Simulator, holding a keyboard key
generates repeated "down" events due to the OS key repeat, rather
than a single down event on press and a single up event on release.
This differs from hardware behavior where physical buttons don't
generate repeat events, and makes it difficult to use
setButtonCallback for triggering one-shot actions (e.g. playNote on a
synth) without adding manual deduplication.
Expected behavior: The Simulator should suppress OS key repeat events
and only deliver one down event per key press to setButtonCallback,
matching hardware behavior.
Steps to reproduce:
- Register a button callback via setButtonCallback
- Log each time the callback fires with down == true
- Hold a button (keyboard key) in the Simulator
- Observe repeated down events firing at the OS key repeat rate
Workaround: Track button state manually and ignore subsequent down
events while the button is already held.