Closed georgemandis closed 5 years ago
I'm not sure when this changed but as of at least iOS 11.2event.key
will return values on the keydown
event. However the arrow keys will show up as UIKeyInputLeftArrow
versus ArrowLeft.
It wouldn't be too hard to rewrite things to listen for arrow keys presses and account for these iOS-specific names, but I think it makes more sense to rewrite the whole thing in a more ES6-friendly way.
Just jotting this down in case anyone out there feels like picking this up :)
Thanks Patrick! That's helpful and promising. Maybe this is the year I get this implemented :)
On Mon, Apr 30, 2018 at 1:11 PM patrick kettner notifications@github.com wrote:
hey @georgemandis https://github.com/georgemandis!
The reason this is happening is because keydown events are (supposed to only be) triggered by keys that create something visual. you want to use the keypress event instead
—
This is now addressed in the 2.0 branch. It’s a little hacky, but I dont’ see a way around it without creating separate methods specifically for hardware keyboards on iOS, which I’d rather not do.
Right now Konami-JS works with gestures on an iPad Pro with the keyboard plugged in. It would be nice if the keyboard worked as well.