Trouble getting keyboard inputs for multiple keys pressed at the same time

Godot Version

4.5.1

Question

I am new to Godot and experimenting with keyboard inputs. Other people seem to have had this same problem, but I’m not sure how they solved it.

I set up a simple program that makes a label visible when the left shift key is down and another label visible when the right shift key is down.

extends Node2D

...

func _process(delta):
	if Input.is_action_pressed("left_shift"):
		$"l_shift".visible = true
	else:
		$"l_shift".visible = false

	if Input.is_action_pressed("right_shift"):
		$"r_shift".visible = true
	else:
		$"r_shift".visible = false

It works great when I press just left shift or just right shift. But when I press both and release them, one of the labels remains visible, even though the key is no longer being pressed. If I press it again and release, it disappears as expected.

For the life of me, I can’t figure out how to get this simple task accomplished.

Thanks!
David

Note the last paragraph in is_action_pressed() reference:

I did more reading and found about the supposed keyboard ghosting issue… but according to this Keyboard Ghosting Interactive Demonstration, my shift keys are A-OK.

I did test it in Godot with “?/” instead of right shift and it worked fine. But right shift is a much nicer key!

So I guess the conclusion is my hardware is fine and my code is fine, but maybe it’s an issue with Godot? Is this case closed, or does anyone have an idea for a workaround?

I’d recommend logging a bug.

1 Like

I’m not able to replicate the issue. Did you configure the input events correctly specifying their physical location too?

System:

Godot v4.5.1.stable - Manjaro Linux #1 SMP PREEMPT_DYNAMIC Fri, 19 Sep 2025 16:09:36 +0000 on X11 - X11 display driver, Multi-window, 1 monitor - Vulkan (Forward+) - dedicated NVIDIA GeForce RTX 4080 SUPER (nvidia; 580.82.09) - AMD Ryzen 9 7950X3D 16-Core Processor (32 threads) - 61.90 GiB memory

Looks the same. Thanks so much for trying to help me!

MacOS Sequoia 15.3

I can consistently replicate it. It may indeed be keyboard itself.

Hi normalized! Have you tried the Keyboard Ghosting Interactive Demonstration — Keyboard Ghosting Interactive Demonstration | Applied Sciences | Microsoft — ?

I had the issue in Godot, but not in the Demonstration. What is their secret?

What I get there is consistent with what I get in Godot. Can’t have both shifts pressed.

Thanks, this is very helpful! Even if I can get it to work on my computer, if it won’t work on other people’s computers, that’s not so great.
I’m slightly heartbroken that my idealized control scheme is impossible. But it’s not my first heartbreak.

Thanks everyone for your help!

1 Like