Closed boyswan closed 4 months ago
Thanks @boyswan, I've decided to use code
https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/code as our key identifier. A note, it is good to have the debug
feature flag turned on, this way you can see the pressed key codes in your browser console :)
I've had thoughts about strongly typing these keys, but due to all the variance, I felt the authors left it as a String
intentionally. What do you think?
With
event: web_sys::KeyboardEvent
, event.key() is" "
for space which does not work.I have tried both string and char:
Perhaps the ability to configure using
event.key
vsevent.code
is needed for this, as in this caseevent.code() == "Spacebar"