New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unexpected behaviour of Keyboard.keysDown #196

Closed
Morendil opened this Issue Mar 12, 2015 · 1 comment

Comments

Projects
None yet
1 participant
@Morendil

Morendil commented Mar 12, 2015

In the KeysDown example: http://elm-lang.org/edit/examples/Reactive/KeysDown.elm

On a Mac, in Chrome, when I press Cmd+Right Arrow the signal continues reporting the key code for Right Arrow after lifting the key. (I first noticed this after accidentally holding down Cmd while moving right in Mario, but KeysDown is a smaller example that reproduces this.)

I'm not sure if this is a bug or some unintuitive consequence of the signals machinery, but in any case there should be a documented way of getting the expected result, i.e. when Right Arrow key is up it is reported as up.

I have reproduced this in 0.15 as well.

@Morendil

This comment has been minimized.

Show comment
Hide comment
@Morendil

Morendil Mar 14, 2015

This seems to be a Mac-specific issue with keyboard event handling: http://bitspushedaround.com/on-a-few-things-you-may-not-know-about-the-hellish-command-key-and-javascript-events/

Maybe there's a way to implement a workaround in elm core, but I can't think of one right now.

Morendil commented Mar 14, 2015

This seems to be a Mac-specific issue with keyboard event handling: http://bitspushedaround.com/on-a-few-things-you-may-not-know-about-the-hellish-command-key-and-javascript-events/

Maybe there's a way to implement a workaround in elm core, but I can't think of one right now.

@Morendil Morendil closed this Mar 15, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment