You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When receiving an InputEventKey pressed for a modifier key input (eg. CTRL), the event responds to is_pressed() with true, but the member variable ctrl_pressed will contain false. This creates a situation where the data reported is inconsistent with itself.
I would expect a key event for a modifier being pressed to have that data consistent across the whole event (ie. ctrl_pressed should also report true, as should is_command_or_control_pressed()).
This issue applies to all modifier keys, CTRL is just being used as an example.
Steps to reproduce
Load the MRP and run the game.
Press control, and see that the log says key_event.is_pressed() is true while the value of key_event.ctrl_pressed remains false.
Optionally, also play with pressing and holding Shift either before or after starting to hold CTRL, and see that the result in key_event.ctrl_pressed is reported differently depending on which key was pressed first.
I can understand this argument, and if it's done intentionally and desired, I won't press the issue. It merely surprised me enough to merit a report.
I agree adjusting the documentation would help reduce the surprise.
Tested versions
System information
Godot v4.3.dev6 - Windows 10.0.22631 - Vulkan (Forward+) - dedicated NVIDIA GeForce RTX 4090 (NVIDIA; 31.0.15.5123) - AMD Ryzen 9 7950X 16-Core Processor (32 Threads)
Issue description
When receiving an InputEventKey pressed for a modifier key input (eg. CTRL), the event responds to
is_pressed()
with true, but the member variablectrl_pressed
will contain false. This creates a situation where the data reported is inconsistent with itself.I would expect a key event for a modifier being pressed to have that data consistent across the whole event (ie.
ctrl_pressed
should also report true, as shouldis_command_or_control_pressed()
).This issue applies to all modifier keys, CTRL is just being used as an example.
Steps to reproduce
Optionally, also play with pressing and holding Shift either before or after starting to hold CTRL, and see that the result in key_event.ctrl_pressed is reported differently depending on which key was pressed first.
Minimal reproduction project (MRP)
ctrl_pressed.zip
The text was updated successfully, but these errors were encountered: