godotengine / godot

Godot Engine – Multi-platform 2D and 3D game engine
https://godotengine.org
MIT License
91.07k stars 21.18k forks source link

Document keyboard ghosting issues #56423

Closed AnEnigmaticBug closed 2 years ago

AnEnigmaticBug commented 2 years ago

Godot version

3.4.2.stable

System information

Ubuntu 20.04.3 LTS, Gnome version 3.36.8, X11 windowing system, Dell XPS 13 9360, i7-8550U CPU

Issue description

While I hold down the up and left arrow keys together, the spacebar stops working (Input.is_action_pressed stops returning true). The reverse is also true, when I hold down spacebar, the up and left arrow keys don't work together: only one of them works.

This issue doesn't occur:

Steps to reproduce

  1. Run the project using F5 or open the Level scene and use F6.
  2. Walk around using the arrow keys or WASD.
  3. Hold spacebar to change the character's color.
  4. Press the up and right arrow keys together and while moving, press spacebar. This will work. The character will change its color while moving diagonally.
  5. Press the up and left arrow keys together and do the same thing. This will not work. The character won't change its color.
  6. Press the W and A keys together and repeat. This will work.
  7. Press the up and left arrow keys together but press LSHIFT instead of spacebar. This will work.
  8. Press spacebar and then press the up and left arrow keys together. The character's color will change but it'll only move in either the up or left direction; not diagonally.

Minimal reproduction project

spacebar_issue.zip

Zireael07 commented 2 years ago

Most likely not a Godot issue, but a hardware issue known as keyboard ghosting.

KoBeWi commented 2 years ago

Yes. This is like tenth report of this issue. I wonder if we can document it somewhere.

PucklaJ commented 2 years ago

I tried out the project just to see if I would have the same issue and I noticed that there is a Camera2D attached to the Player. Is this intentional? Because with this setup you don't notice if the Player moves. I moved the camera from the Player scene to the Level scene and now it works as I would expect. This may be unrelated to this issue, but I wanted to mention it just if someone tries out the project and is confused as to why the character doesn't move.

AnEnigmaticBug commented 2 years ago

@PucklaMotzer09 the camera placement was intentional (but unrelated to the bug). I wanted it to remain centered on the character. People can sense the movement by noticing the floor tiles.

AnEnigmaticBug commented 2 years ago

I wonder if we can document it somewhere.

Along with that, it might be a good idea to mention some strategies to minimize/avoid ghosting (see this StackOverflow answer).