0 votes

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.

in Engine by (61 points)

Can you post the code?

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

2 Answers

0 votes

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

https://en.wikipedia.org/wiki/Rollover_(key)

by (3,252 points)

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

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.

Hello,

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

+1 vote

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 : https://drakeirving.github.io/MultiKeyDisplay/

Other has the same issue here
https://github.com/godotengine/godot/issues/846

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

by (32 points)
Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to webmaster@godotengine.org with your username.