godotengine / godotengine/godot

Joystick Motion not triggering Pressed signal on Button when assigned via Shortcut

Open
#99,331 10 comments 0 reactions 0 assignees View on GitHub
bug topic:gui topic:input
Dominant language
C++
Stars
117k
Forks
26.8k
PR merge metrics
PR metrics pending

Description

### Tested versions

4.3.stable.mono (official download)

### System information

Godot v4.3.stable.mono - Windows 10.0.19045 - Vulkan (Mobile) - dedicated NVIDIA GeForce RTX 3090 (NVIDIA; 32.0.15.6109) - Intel(R) Core(TM) i9-10900K CPU @ 3.70GHz (20 Threads)

### Issue description

When you attach InputEventAction shortcut to a Button, the button will not trigger it's pressed signal in response to that shortcut if the shortcut is triggered by gamepads joystick. At the same time if you log in the `Input.IsActionPressed` for the same InputEventAction in the `_Process` function, it correctly detects the action as pressed from joystick motion event.

I also tried using InputEventJoypadMotion in the Shortcut (instead of InputEventAction), but this also did not trigger the Shortcut.

### Steps to reproduce

See attached project. There's single button with `ui_up` action assigned via Shortcut. The pressed signal for the button logs "UP", and in the `_Process` the same action is checked and if detected as pressed spam-prints "UP in _Process" line.

Upon launching, if you press up arrow on keyboard or up arrow on the gamepad DPAD, you will see in logs:
```
"UP"
"UP in _Process"
"UP in _Process"
"UP in _Process"
... (repeats the same as long as you keep the action pressed)
```

If you instead use the joystick and move it upwards, the logs will only show:
```
"UP in _Process"
"UP in _Process"
"UP in _Process"
... (repeats the same as long as you keep the action pressed)
```

The button does not respond to the action being pressed, even though the action is clearly marked as pressed from the other code path.

### Minimal reproduction project (MRP)

[joystickinputrepro.zip](https://github.com/user-attachments/files/17787663/joystickinputrepro.zip)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.