Skip to content
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

Arrow keys UP+DOWN not recognized when holding spacebar! #949

Closed
DrHackenstein opened this issue Jun 27, 2014 · 6 comments
Closed

Arrow keys UP+DOWN not recognized when holding spacebar! #949

DrHackenstein opened this issue Jun 27, 2014 · 6 comments

Comments

@DrHackenstein
Copy link

This is a strange phenomenon, that's unfortunately very problematic for my game: If the space key is held down pushing the left and upper arrow key simultaneously will not be recognized. However the other combinations (up+right, down+right, down+left) are recognized!

This can be easily reproduced in the examples:
http://examples.phaser.io/_site/view_full.html?d=input&f=cursor+key+movement.js&t=cursor%20key%20movement
Though holding space will scroll the page, it's easy to memorize where the ball was at start (upper left corner). Now if you hold space and push up+left for a while, then scroll back up you can still see the ball exactly where he was. If instead you hold space and push up+right this will not be the case.

Using Phaser Master v2.0.5. Tested on Chrome 31.0.1650.63 m & Firefox 30.0

EDIT: It's easier to test in Invaders. Holding space to shoot and then pushing left+up and the ship won't move, but holding space and pushing left+down works:
http://examples.phaser.io/_site/view_full.html?d=games&f=invaders.js&t=invaders

@lewster32
Copy link
Contributor

This may not be a Phaser issue, but in fact a hardware issue. Keyboards often do not accept certain combinations of keys, especially when dealing with the cursor keys. Could you try using other combinations of keys to determine if this is truly a Phaser issue? For instance, using shift + WASD - or other keys which in normal use are meant to be held together.

@DrHackenstein
Copy link
Author

At first I thought so, too. But space + WASD works fine, space + numpad Keys (8456) works fine, enter + arrow keys work fine, etc. This would be the weirdest hardware limitation space+left+up doesn't work, but space+left+down works.

@lewster32
Copy link
Contributor

If Space + WASD works fine then this is definitely a hardware issue, called 'key jamming': http://en.wikipedia.org/wiki/Rollover_(key)#Key_jamming_and_ghosting

As a lefty who plays fps games, this affects me a lot - the cursor keys don't play well with the rest of the keyboard.

@photonstorm
Copy link
Collaborator

This is a hardware issue, I even mention it in the Keyboard class documentation!

* Please be aware that lots of keyboards are unable to process certain combinations of keys due to hardware
* limitations known as ghosting. Full details here: http://www.html5gamedevs.com/topic/4876-impossible-to-use-more-than-2-keyboard-input-buttons-at-the-same-time/

In the Invaders example above I can quite happily hold space and move left + up, because I use a gaming grade keyboard.

@DrHackenstein
Copy link
Author

Ok, so this is the weirdest hardware limitation. Thanks, guys! :)

@photonstorm
Copy link
Collaborator

It's probably one of the most annoying ones too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants