onKeyReleased not working with physicalKeyboardHighlightPress

This issue has been tracked since 2022-04-12.

Simple-keyboard version

Describe the bug
I'm utilizing physicalKeyboardHighlightPress and am noticing that onKeyReleased does not seem to do anything when I release a key. It only seems to fire when I click and release the virtual keyboard with my mouse.


hodgef wrote this answer on 2022-04-13

Hey @jamesgoodhouse, onReleased only triggers "on pointer up", and physicalKeyboardHighlightPress triggers the button handler directly.

I have added a new option called physicalKeyboardHighlightPressUsePointerEvents: true (sorry for the long name) which uses onpointerup and should resolve your issue. Feel free to update and give it a try.

Francisco Hodge

jamesgoodhouse wrote this answer on 2022-04-13

Awesome, thank you so much! I'll give it a go.

jamesgoodhouse wrote this answer on 2022-04-13

So looks like it's working; not as I was expecting, but likely how it's intended. If I hold the key down on the keyboard, it basically does a key repeat (which is normal behavior for a keyboard), and thus firing the "key up" event continually. I was hoping to be able to implement behavior such that when you hold a key down, it registers a single keystroke, and then when you release the key, it triggers the key up event.

jamesgoodhouse wrote this answer on 2022-04-13

I did see there's the disableButtonHold option, but appears to only work with the mouse events and not the physical keyboard.

hodgef wrote this answer on 2022-04-15

Sorry about that, I didn't do the initial fix correctly. Feel free to update to latest and give it another try, hopefully this time it works!

Note: The newest fix only prevents pointerup from firing multiple times. This won't make it so you get only one pointerdown when you hold the button. The handler for the button press is still fed directly to the keydown listener (

handleKeyDown(event: KeyboardHandlerEvent): void {

Francisco Hodge

More Details About Repo
Owner Name hodgef
Repo Name simple-keyboard
Full Name hodgef/simple-keyboard
Language JavaScript
Created Date 2018-03-02
Updated Date 2022-12-06
Star Count 1738
Watcher Count 20
Fork Count 130
Issue Count 0


Issue Title Created Date Updated Date