How to use shortcuts with modifier

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

I am looking for something like this I thought godot checks this internally. Try to press CONTROL+S.

Expected result CONTROL_S

func _process(event):
	if Input.is_action_just_pressed("CONTROL_S"): # KEY_CONTROL+KEY_S
		print("CONTROL_S")

	if Input.is_action_just_pressed("S"): # KEY_S
		print("S")

# Output: CONTROL_S and S

This works but I can’t use it in my case

func _process(delta):
	if Input.is_action_just_released("CONTROL_S"): # KEY_CONTROL+KEY_S
		print("CONTROL_S")

	if Input.is_action_just_released("S") && !Input.is_action_just_released("CONTROL_S"): # KEY_S
		print("S")

# Output: CONTROL_S

The actions without any modifier should check that no actions with the same key and any modifier is pressed.