godotengine / godotengine/godot

Shift + ui_accept does not work with pressed signal on button

Open
#96,604 4 comments 0 reactions 0 assignees View on GitHub
discussion topic:gui topic:input
Dominant language
C++
Stars
117k
Forks
26.8k
PR merge metrics
PR metrics pending

Description

### Tested versions

Godot v4.4.dev1
Godot v4.0.stable

### System information

Fedora Linux 40 (KDE Plasma) - Wayland - Vulkan (Forward+)

### Issue description

Shift + ui_accept (same with Ctrl, Alt) does not work with pressed signal on button when usign this code:

_This code works if you switch KEY_SHIFT to KEY_A_

```
func _on_pressed() -> void:
if Input.is_key_pressed(KEY_SHIFT):
print("Shift was pressed")
```

This works in Godot 3

### Steps to reproduce

connect pressed signal to a script
see code above
grab button focus
press shift + ui_accept
nothing is printed

### Minimal reproduction project (MRP)

[shift-and-accept-in-pressed.zip](https://github.com/user-attachments/files/16888279/shift-and-accept-in-pressed.zip)

Contributor guide

Open the contributing guide

Research direction

Start with the attached shift-and-accept.zip minimal reproduction and reproduce the issue using the button's pressed signal, ui_accept, and Input.is_key_pressed(KEY_SHIFT). Trace the button activation and input handling entry points to compare modifier-key behavior with KEY_A and Godot 3; done means Shift, Ctrl, and Alt are observable when activating the focused button as described.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp, godot
Domain
game-dev
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.