Topic was automatically imported from the old Question2Answer platform.
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
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