Skip to content
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

Recent input change breaks existing input maps #99243

Closed
Gaktan opened this issue Nov 14, 2024 · 3 comments · Fixed by #99449
Closed

Recent input change breaks existing input maps #99243

Gaktan opened this issue Nov 14, 2024 · 3 comments · Fixed by #99449

Comments

@Gaktan
Copy link
Contributor

Gaktan commented Nov 14, 2024

Tested versions

Reproducible in v4.4.dev.custom_build [76fa7b2]
Not reproducible in Reproducible in v4.4.dev.custom_build [0a4aedb]

System information

Windows 10 - Vulkan

Issue description

Found this bug after updating my godot fork, I didn't investigate what change caused this.

Previously set input events had a "-1" device value in my project. I don't know if it was previously an expected behaviour or not. But the new behaviour expects the device value to be >= 0.

For example, an input event define in my project settings as:

"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":84,"physical_keycode":0,"key_label":0,"unicode":116,"location":0,"echo":false,"script":null)

Existing values should be converted to the new expected value if possible. Otherwise users must be warned to make the manual change.

Steps to reproduce

Add the following skip action into your project:

[input]

skip={
"deadzone": 0.5,
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":84,"physical_keycode":0,"key_label":0,"unicode":116,"location":0,"echo":false,"script":null)
]
}

Catch the action in your code using Input.is_action_pressed("skip")
Attempt to trigger the action by pressing 'T'.
Notice is_action_pressed never returns true.

Minimal reproduction project (MRP)

N/A

@Meorge
Copy link
Contributor

Meorge commented Nov 14, 2024

Sorry I don't have more concrete info to add here, but I did want to mention that I think this bug (or a very similar one) caught me when I tried running a 4.4-dev3 project on 4.4-dev4. I think I remember in my case it set the device ID for my input map to -3? Luckily, I was able to revert the changes using Git, but it definitely still got me off guard.

Edit: Just moved my project forward to use the master branch instead of 4.4-dev3, and caught this again:

CleanShot 2024-11-17 at 10 52 37@2x

@Jarwhal3
Copy link

I have this issue as well, it updated my 4.3 project input maps from -1 to -3. It's not just a project upgrade issue though.

I just created a new, empty 4.4 dev 3 project and added an input action to it, and it set the device to -3 instead of the previously expected -1.

image

@Meorge
Copy link
Contributor

Meorge commented Nov 17, 2024

The change from -1 to -3 is due to this PR, I discovered: #97707

I haven't had the chance to experiment much with how this impacts the actual device usability though

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Unassessed
Development

Successfully merging a pull request may close this issue.

5 participants