hodgef / react-simple-keyboard

React Virtual Keyboard - Customizable, responsive and lightweight
https://virtual-keyboard.js.org/react
MIT License
569 stars 62 forks source link

useMouseEvents not working #2936

Open adventmedia opened 2 days ago

adventmedia commented 2 days ago

version: 3.8.20 Microsoft Edge 130.0.2849.80 on MacOS 15.1

Describe the bug with useMouseEvents={true}, onKeyPress is still returning pointer events:

`const onKeyPress = (button: string, evt?: MouseEvent) => { console.log(‘onKeyPress’, button, evt);

Screenshots the console.log screenshot_1344

Or do I misunderstand what useMouseEvents does?

hodgef commented 2 days ago

Hello @adventmedia,

Your understanding is correct. It appears that the browsers return PointerEvents out of the onclick.

image

But still return MouseEvent when using onmousedown

image

Will have a look later on how to fix this without introducing a breaking change. Thanks