Inputs containing multiple keys also register all subcombinations

Godot Version

Godot 4.5 (on steam im pretty sure)

Question

Not entierly sure how to frase this lol sry ^^*

but basicly i want to map each keyboard number to a input (0-9) and want unique combinations based on if u are also holding control, shift, alt or none at the same time. But when i do this it is registering both the held key version and the normal number version.

Ex. if u click 4+shift, it activated the 4 code and the 4+shift code instead of only the 4+shift code.

In the example code below both the function(); and function_ctrl(); would be called

if(Input.is_action_just_pressed("input1")):
	function();
if(Input.is_action_just_pressed("inputctrl1")):
	function_ctrl();
if(Input.is_action_just_pressed("inputshift1")):
	function_shift();
if(Input.is_action_just_pressed("inputalt1")):
	function_alt();

This is essentually what my code looks like but…mesier and larger but shouldnt matter.

In my actual code im using if elif statments with the mono number input last and its still somehow prioritised.

If anyone knows if this is a bug or if im doing something wrong, please let me know ^^

Using “just pressed” won’t work for this because it would require the player to press both keys at exactly the same frame, which is very unlikely to happen. Use input event handler instead. You can query the state of the modifier keys via the received event object.

I think the pareters exact match can help with that !

Input.is_action_pressed(“action”, true)

Maybe create a cooldown to be sure.

that definetly could help, didnt know about it thank you will try it later ^^