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

Bug when adding multiple keys to input map #44155

Closed
IndieQuest opened this issue Dec 7, 2020 · 5 comments · Fixed by #44181
Closed

Bug when adding multiple keys to input map #44155

IndieQuest opened this issue Dec 7, 2020 · 5 comments · Fixed by #44181

Comments

@IndieQuest
Copy link

IndieQuest commented Dec 7, 2020

Godot version:
v4.0.dev.custom_build.93b107ac9

OS/device including version:
Windows 10, Nvidia 1070

Issue description:
When adding multiple keys in succession a new input binding is created with the name of the last entered key (see video).

Steps to reproduce:

  1. Open project settings
  2. Go to the input map tab
  3. Create a new action
  4. Add A as a key for the new action
  5. Without pressing anything else, add the S key to the same action

Minimal reproduction project:
Test.zip

@IndieQuest
Copy link
Author

Just saw that the video I attached is corrupted.
Adding an new one with some more examples and behaviors regarding this issue.
BTW, I could not find the relevant code that handles input mapping but if you could point me to it I would love to take a swing at fixing the issue.
InputMapBug.zip

@akien-mga
Copy link
Member

The relevant code should be in editor/input_map_editor.cpp.

@IndieQuest
Copy link
Author

IndieQuest commented Dec 7, 2020

I am able to conclude that in some cases the TreeItem sent to this function is referencing the first child of the actual action instead of the action itself.
This is the first time I am working with the editor code so I am not yet familiar with how everything works, will continue working on this tomorrow.

@EricEzaM
Copy link
Contributor

EricEzaM commented Dec 7, 2020

That is pretty weird - I have worked quite a bit with the editor code and just a warning, this may not be trivial to solve.

FYI I am in the middle of a bit of a rewrite of the input map editor, I actually remove input_map_editor.cpp and replace with with another, more generic implementation that is not dependant on Project Settings and thus could be used elsewhere if required in the future. It adds UI to expose #43662 to the user interface, and it is partially dependent on #43663 getting merged.

Here is a preview of what it looks like. Since I did a complete rewrite this bug does not seems to be there.

inputmap_demo

@pouleyKetchoupp
Copy link
Contributor

For info, I've spotted a similar bug when adding keys to multiple actions in a row: #44227.

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

Successfully merging a pull request may close this issue.

4 participants