https://github.com/FormidableLabs/react-game-kit/blob/master/demo/slides/index.js#L36-L37
Adds both keyupand keypresslisteners.
In Chrome/Edge, the arrow keys only fire keyup.
But in Firefox, both events get fired and it results in a double key press.
I don't know if it a matter of just removing the keypresshandler? Or keeping both and handling it with some logic on the browser type? I am not a front end guy, and googling hasn't led me to a definitive solution, so if you have thoughts, I am sure you all handle this kind of stuff all the time. I am happy to submit a PR if you suggest a solution.
https://github.com/FormidableLabs/react-game-kit/blob/master/demo/slides/index.js#L36-L37 Adds both
keyup
andkeypress
listeners. In Chrome/Edge, the arrow keys only firekeyup
. But in Firefox, both events get fired and it results in a double key press. I don't know if it a matter of just removing thekeypress
handler? Or keeping both and handling it with some logic on the browser type? I am not a front end guy, and googling hasn't led me to a definitive solution, so if you have thoughts, I am sure you all handle this kind of stuff all the time. I am happy to submit a PR if you suggest a solution.