-
Notifications
You must be signed in to change notification settings - Fork 101
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
Input.is_action_just_pressed is not returning true after corresponding InputSender.action_down calls. #654
Comments
This has been fixed in 9.3.0. |
Thanks! It looks like upgrading to GUT 9.3.0 fixed that test (and in my game's test as well), however I noticed when running the example test script again that a different test was failing "test_when_uai_enabled_just_pressed_is_not_processed_immediately", which I'm assuming is expected or possibly related to #642: PS D:\godot_airplane_game> &"d:\mystuff\SteamLibrary\steamapps\common\Godot Engine\godot.windows.opt.tools.64.exe" -s res://addons/gut/gut_cmdln.gd -d -gselect="test_gut.gd" --- GUT --- res://scripts/tests/unit/test_gut.gd
==============================================
|
I think At first I thought it might be related to setting the In any case, the code in the docs should have been explicitly setting extends GutTest
var _sender = InputSender.new(Input)
var _orig_accum_input = Input.use_accumulated_input
func before_all():
InputMap.add_action("jump")
Input.use_accumulated_input = true
func after_all():
Input.use_accumulated_input = _orig_accum_input
InputMap.erase_action("jump") # I added this too, probably the right thing to do. |
Partially confirmed that this test doesn't apply to 4.x anymore. The tests still pass in 3.x. At some point in Godot 4 the action handling split off a bit from other input handling. |
Versions
(list all versions where you have replicated the bug)
Godot: v4.2.2.stable.official [15073afe3]
GUT: 9.2.1
OS: Windows 10
The Bug
Input.is_action_just_pressed returns false after calling InputSender.action_down on the corresponding action type.
Steps To Reproduce
I was able to reproduce this with the following example code from the documentation:
https://gut.readthedocs.io/en/latest/Input-Sender.html#id1
I copied that example code into a test file, ran the script in vscode (GUT: Run Current Script), and all the tests passed except for the last one "test_when_uai_enabled_flushing_buffer_just_pressed_is_processed_immediately".
Here's the output:
res://scripts/tests/unit/test_gut.gd
[Passed]
[Passed]
[Passed]
[Passed]
[Passed]
[Passed]
[Failed]
at line 43
5/6 passed.
==============================================
= Run Summary
res://scripts/tests/unit/test_gut.gd
[Failed]:
at line 43
---- Totals ----
Scripts 1
Tests 6
Passing 5
Failing 1
Asserts 7
Time 0.266s
Ran Scripts matching "test_gut.gd"
---- 1 failing tests ----
The text was updated successfully, but these errors were encountered: