Platform bug with arrow keys + spacebar

0 favourites
  • 10 posts
From the Asset Store
Game with complete Source-Code (Construct 3 / .c3p) + HTML5 Exported.
  • Problem Description

    There's an issue when trying to use a certain combination of arrow keys (left and up) and the spacebar at the same time. So for example, if you wanted to have a player jumping and shooting (with space bar) at the same time the shooting won't occur if the player is holding the left and up keys at the same time

    Attach a Capx ... sp=sharing

    edit: zenox98 also has a good capx for testing this, see link in his post below

    Description of Capx

    simple platform demo

    Steps to Reproduce Bug

    • at the same time push the right and up arrow key on the keyboard, follow that shortly by pushing the spacebar while player is still in the air. You'll notice the text at the top changes to "spacebar is down". This is all good and well.
    • now, at the same time push the left and up arrow key on the keyboard, follow that shortly by pushing the spacebar while player is still in the air. You'll notice the text at the top remains "spacebar is NOT down" but should change to "spacebar is down" when pressed. Something is keeping the spacebar from registering while the left and up arrow keys are down.

    Observed Result

    spacebar tap doesn't register when left and up keyboard keys are down

    Expected Result

    spacebar tap should be recognized even when left and up keyboard keys are down

    Affected Browsers

    • Chrome: YES
    • FireFox: YES

    Operating System and Service Pack

    Windows 8.1 Pro

    Construct 2 Version ID


  • It actually works OK for me, showing 'Space is down' as expected when moving left or right.

    Remember to check on different keyboard if possible, as certain keyboards can cause this issue to manifest.

  • hm. I tried a different keyboard and it still seems the same...

    zenox98 Do you keep the left arrow and up arrow pressed (don't let go of) as you push the spacebar?

  • Yes. I even set timescale to 0.25 so it has more time to see the result and it works every time.

    I amended your .capx to test for all 3 conditions, and to set a text box if all 3 keys are registered. Works every time for me.

  • zenox98

    interesting, thanks for testing that and the new capx. I can't get the "left ok" to show up using your capx though I can get the right OK to show up easily. I even tried on another computer (so I've tested both windows and mac chrome browsers, also tried safari on mac). What operating system and browser are you on?

    no big deal but there is a minor typo in your capx, need to change txtLeft to txtRight in the last action of your last event

  • Using r172 C2 64 bit version on Windows 7 Home Premium Service Pack 1 64-bit.

    I don't understand it - I feel like I'm missing something, but it definitely works in both directions for me.

    Hopefully, others (come on people!!!) will test also.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • thanks for the link Yeah with the test on that page spacebar doesn't register when I am holding down left and up... so sounds like this is a limitation of my computer or keyboard and not an issue with Construct 2 itself

  • Thanks for the link, I knew about the issue but never knew it had the 'official' term of ghosting.

    Maybe the Keyboard plugin item in the C2 manual should add the term and explanation for future reference.

  • Closing as not a bug: not all keyboards can reliably detect three simultaneous keypresses. Some other combinations using keys from different parts of the keyboard may work better, e.g. using letters, spacebar, arrow keys, ctrl/shift etc. separately. You must take this in to account when designing games. It happens at the hardware level so there is nothing any software, browser or operating system can do to avoid this.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)