InputEventAction is_match
method ignores exact_match parameter
#63108
Labels
Milestone
is_match
method ignores exact_match parameter
#63108
Godot version
3.4.4, 3.5-rc6 and 4.0.alpha (custom build)
System information
openSUSE Tumbleweed with KDE Plasma
Issue description
InputEventAction
'sis_match
method completely ignores theexact_match
parameter and it is always false. This bug also happens on 3.x'sshortcut_match
method.As a result, button nodes with
ShortCut
s get fired even if the key combination is not exact. In the minimal reproduction project, there are two buttons, one with aShortCut
with anInputEventAction
mapped to the S key, and another button mapped to Control + S. On Godot 3.x, both buttons get fired while holding Control + S, while only the second button should get fired. On Godot 4.x, Control + S only executes the second button, but S does not seem to release the first button. Both issues are seemingly solved ifInputEventAction
'sis_match
takesexact_match
into account, which is true by default. I will soon open a PR that provides a fix.EDIT: The PR is #63109.
If this behavior is intentional, then it might be worth it to introduce a new property for
ShortCut
, that lets users decide if theShortCut
should check for exact matches or not. Although, from my understanding, this is not intentional, since all otherInputEvents
inShortCut
s are exact matches, with no way to change that, soInputEventAction
should be too.Steps to reproduce
Button
nodes and provide aShortCut
for each of them. For the first button'sShortCut
, add anInputEventAction
that corresponds to the single key button input action (in our example, S), and for the second button'sShortCut
, add anInputEventAction
that corresponds to the key button with a modifier input action (in our example, Control + S).pressed
signal if the action mode is set to Button Release.Minimal reproduction project
The project is for 4.0, but a similar project made for 3.x has the same issue.
InputEventAction bug.zip
The text was updated successfully, but these errors were encountered: