Repository: godot
Issue: When multiple controller or other Input devices are mapped to the same InputMap action, the action is "eaten" or not consistently triggered
Labels: discussion,topic:input

### Tested versions

Godot 3.5.3 stable, 4.2.1 stable, 4.3. Dev1

### System information

Win 10, Nvidea RTX 1080, GLES3, Forward+

### Issue description

In situations where two or more controllers or other input devices have the same event mapped to an InputMap action I would expect all input presses and releases to be registered.

This however is not the case in any Godot version I have tested.

This is especially problematic for couch coop games when many players should be allowed to perform the same action. With Godot's current implementation **the Godot dev cannot decide which input to give priority or which input to neglect, or to execute on all of the registered input presses or releases**, because not all of the Input presses and releases are registered and triggered.

Example:

Given two joypads are mapped to the same action (let's call the action "joy_a") and both press the mapped input (let's say button A on two Xbox controller for example), then one of the joypads released the button and then the other ...

```gdscript
func _process(delta):
	if Input.is_action_just_pressed("joy_a"):
		print("joy_a is just pressed")
	if Input.is_action_just_released("joy_a"):
		print("joy_a is just released")
```

I would expect this to print:
> joy_a is just pressed
> joy_a is just pressed
> joy_a is just released
> joy_a is just released

So all of the joypad "presses" and "releases" I would expect to register and print.
I tested this in Godot 3.5.3, 4.2.1 and 4.3.dev1, none of those produce this result:

Godot 3.5.3:
> joy_a is just pressed
> joy_a is just released

Godot 4.2.1:
> joy_a is just pressed
> joy_a is just released
> joy_a is just released

Godot 4.3 dev1:
> joy_a is just pressed
> joy_a is just released

I also tested all of this with a single Input (All Devices) mapping, and with two mappings (for both Device 0, Device 1), same result. To be clear, I would expected the result to be the same. I just wanted to be sure this is not correlated.

It first glance it seems like Godot 3.5.3 and Godot 4.3. Dev1 behave the same. But they do not. If you press and hold A on joypad_0, then repeatedly quickly press A on the other joypad_1 (while still holding A on joypad__0), in Godot 3.5.3, the first "press" is from the joypad_0, the first "release" is from joypad_1, and then it's only joypad_1 printing "press" and "release":

Godot 3.5.3:
> joy_a is just pressed  (joypad_0)
> joy_a is just released  (joypad_ 1)
> joy_a is just pressed  (joypad_ 1)
> joy_a is just released  (joypad_ 1)
> joy_a is just pressed  (joypad_ 1)
> joy_a is just released  (joypad_ 1)
> joy_a is just pressed  (joypad_ 1)
> joy_a is just released  (joypad_ 1)

Note: When finally releasing A on joypad_0, (which was held all while pressing A joypad_1 repeatedly), it _**won't**_ print "released"!

In Godot 4.2.1:
> joy_a is just pressed  (joypad_0)
> joy_a is just released  (joypad_ 1)
> joy_a is just pressed  (joypad_ 1)
> joy_a is just released  (joypad_ 1)
> joy_a is just pressed  (joypad_ 1)
> joy_a is just released  (joypad_ 1)
> joy_a is just pressed  (joypad_ 1)
> joy_a is just released  (joypad_ 1)
> joy_a is just released   (joypad_0)

In contrast to Godot 3.5.3, joypad_0 **_will_** print "release" once it is finally released! But the first joypad_1 "pressed" is not printed.

In Godot 4.3 Dev1:
> joy_a is just pressed  (joypad_0)
> joy_a is just released   (joypad_0)

Godot 4.3 Dev1 is totally different once again, **_not printing either_** "pressed" nor "released" of joypad_1, regardless how often you press A on joypad_1, while Button A of joypad_0 is held.

To reiterate, what **I would expect is all joypad presses and released to register and print.** So in the above example of A on joypad_0 being held while A on joypad_1 is repeadedly pressed, I would expect this to print:

> joy_a is just pressed  (joypad_0)
> joy_a is just pressed  (joypad_ 1)
> joy_a is just released  (joypad_ 1)
> joy_a is just pressed  (joypad_ 1)
> joy_a is just released  (joypad_ 1)
> joy_a is just pressed  (joypad_ 1)
> joy_a is just released  (joypad_ 1)
> joy_a is just pressed  (joypad_ 1)
> joy_a is just released  (joypad_ 1)
> joy_a is just released  (joypad_0)

However none of the Godot versions I tested behaved as expected.

### Steps to reproduce

1. Connect two joypad controllers.
2. In the InputMap Project Settings map Joy button A (All Devices or both devices separately, does not matter) to the same input action called "joy_a"
3. run the code example below:

```gdscript
func _process(delta):
	if Input.is_action_just_pressed("joy_a"):
		print("joy_a is just pressed")
	if Input.is_action_just_released("joy_a"):
		print("joy_a is just released")
```

### Minimal reproduction project (MRP)

Godot 4.3. Dev1: 
[multiple_devices_same_input_action_bug.zip](https://github.com/godotengine/godot/files/13753553/multiple_devices_same_input_action_bug.zip)

Unsure if this is a related issue: https://github.com/godotengine/godot/issues/86272