Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | 2ndGarrison | |
Old Version | Published before Godot 3 was released. |
Hello,
In the Input Map, you can create actions and set keystrokes or other triggers for those actions. The Input Map also lets you assign combined keystrokes (e.g. Alt+Up, Ctrl+Left). I have an _input function and flags to check if those combined keystrokes are registering. For actions that only require one key, I have no problem registering, but actions that rely on combined keystrokes do not register. Here a bit of code I’m running to demonstrate:
func _input(event):
if(event.type == Input.is_action_pressed("ui_accept")):
print("UI ACCEPT")
elif(event.type == Input.is_action_pressed("attack")):
print("ATTACK")
The action “ui_accept” is tied to Enter and Spacebar and a few other things. That registers just fine.
The action “attack” is tied to Ctrl+Right (left control) + (right arrow key). This never registers. Am I doing something wrong to try to handle it?
I try checking the box that’s in the Input Map, and that seems to simply remove the need to press Ctrl and “attack” is triggered by just hitting the right arrow key. I can change the controls for now if this just doesn’t work, but I’d like to be able to use combined keystrokes.