Trouble with left key in combination with space key (maybe bug?)

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By popon2

Hi, I have a strange issue with input key… I setup a “left” input action as a left key or A-key (typical setup for games WSAD or arrow keys). Those keys are for movement and there is also space key for shooting. But for left key in combination with space key it wont shoot (basic test print("shoot") nothing). Movement using left key work, but when is pressed it ignore space key.
For combination A-key and space it works, same result for right key or D-key, just left key. I don’t know why…
Don’t worry, I checked imput map, but it’s setup correctly.

Can you post the code?

oskfo | 2019-04-07 23:14

func get_input():
rot_dir = 0
if Input.is_action_pressed("up"):
	trust_on = true
else:
	trust_on = false
	slow(0.01)
if Input.is_action_just_pressed("down"):
	slow(0.2)
if Input.is_action_pressed("right"):
	if rot_speed < max_rot_speed:
		rot_speed += rot_acc
if Input.is_action_pressed("left"):
	if rot_speed > -max_rot_speed:
		rot_speed -= rot_acc
if Input.is_action_pressed("shoot"):
	var bullet = Bullet.instance()
	bullet.position = position
	get_parent().add_child(bullet)

if not (Input.is_action_pressed("left") or Input.is_action_pressed("right")):
	if rot_speed < -0.03:
		rot_speed += rot_acc/2
	elif rot_speed > 0.03:
		rot_speed -= rot_acc/2 
	elif rot_speed > -0.03 and rot_speed < 0.03:
		rot_speed = 0

popon2 | 2019-04-08 05:16

:bust_in_silhouette: Reply From: wombatstampede

Might just be a limitation of your keyboard. I suggest you try it out on another computer (non-laptop) or with another keyboard.

I was think about that, but why it works for right arrow key and for left not… but i will try differend pc

popon2 | 2019-04-08 09:59

It is weird, same issue with space key, only works up + right arrow key, but assign any key other than space key, then all key combo works.

Idleman | 2020-06-20 15:40

Hello,

I think if a bug in the game engine, I have the exact same issue…
Right and space work, left and space not.

cmzx | 2020-07-23 16:19

:bust_in_silhouette: Reply From: cmzx

The issue is hardware related

It is called “keyboard ghosting combination”… Sound like an hardware bug
Test the combination here and you will see that it is not godot related : Keyboard Ghosting Demonstration

Other has the same issue here

I found that my keyboard is not a very good one, I will buy a new I think :slight_smile: