-
-
Notifications
You must be signed in to change notification settings - Fork 21.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Regression: InputEvent.is_action_pressed is true for Control+<key> even if only <key> is pressed when not using exact_match #57943
Comments
@EIREXE Please upload a minimal reproduction project to make this easier to troubleshoot. |
Likely related to #54174, CC @nathanfranke. |
Cannot reproduce in 118494d Both func _ready():
var key := InputEventKey.new()
key.scancode = KEY_D
key.control = true
key.pressed = true
if key.is_action_pressed("test", false, true):
print("Press 1")
func _input(event):
if event.is_action_pressed("test", false, true):
print("Press 2") |
@nathanfranke is exact_match needed now? It used to not be needed I believe the behavior has changed from before |
MRP has been uploaded, it's not too complicated though |
With Is this what you get too? |
Yep, that is what I get, in 3.4.2 only control d works |
I consider that expected behavior, but maybe we can get other input |
Well if it's breaking compat it might be problematic. Maybe this should default to |
to me that sounds like a good way to do it |
I would argue that would break more compatibility, since with Right now it behaves as the documentation describes:
|
Well that's how it behaves in 3.4, no? func _input(event):
if event.is_action_pressed("action_d"):
print("d pressed")
if event.is_action_pressed("action_ctrl_d"):
print("ctrl+d pressed") Pressing D prints |
I confirm that there has been a change in behaviour in 88e2c51 (but no change in behaviour between 3.4 and 3.4.3): In 88e2c51 with Action: Ctrl+D:
In 3.4.3 with Action: Ctrl+D:
Pressing D now returns positive for an Action with Ctrl+D whereas before it didn't. Previously the parameter In 88e2c51 with Action: D:
In 3.4.3 with Action: D:
|
@nathanfranke Sorry, thats probably my bad in the way that I wrote the feature but did not write the doco for it. Doco PR: #51064 Implementation PR: #44355. It would probably be more correct to say
If the action is |
Godot version
3.x c7f09c1
System information
Arch Linux
Issue description
When assigning a key with a modifier to an input event (such as Control+D) it works with is_action_pressed unless exact_match is specified, I believe this is a regression as this was never the behavior before. I can confirm it didn't happen in b423dc0
Steps to reproduce
Create a new input event with a modifier such as Control+d and try checking for it in an input event using
InputEvent.is_action_pressed
Minimal reproduction project
mrpok.zip
The text was updated successfully, but these errors were encountered: