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

Fixes is_action_released firing with no modifiers #41526

Closed

Conversation

Lunatoid
Copy link
Contributor

Should fix #34502
If you have an action like "CTRL + A", it will now fire on both press and release, however if you release "CTRL" while still holding "A" it will not fire the release event.

Also tested with just modifier keys like only "CTRL" or "CTRL+SHIFT" and that still works.

@aaronfranke
Copy link
Member

@Lunatoid Is this still desired? If so, this should be rebased on the latest master branch. While this PR has no conflicts, rebasing is helpful for ensuring the PR still works and it makes testing easier.

Should fix godotengine#34502, now it checks if the keycode matches
and seperately if the modifiers also match.

Let's say we have an action that is bound to CTRL+"A"
This means that holding CTRL and then pressing and
releasing "A" will now appropiately fire the events.

One thing to note is that pressing CTRL+"A" and then
releasing CTRL while still holding "A"  does not fire
the release event.
@Lunatoid Lunatoid force-pushed the enforce-key-mods-on-release branch from 8410f2c to 656e923 Compare January 20, 2021 07:47
@Lunatoid
Copy link
Contributor Author

Just rebased locally and everything still works.

@akien-mga akien-mga requested a review from a team January 20, 2021 09:00
@akien-mga
Copy link
Member

Related to #44355, you might want to participate in the discussion there.

CC @EricEzaM @groud

Copy link
Contributor

@EricEzaM EricEzaM left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Its buggy for me. MRP attached.

I have 2 actions set up. "z" and "ctrl z". Press Ctrl Z, and both "Only Z" and "Ctrl Z" are printed to the console (expected, although I disagree that this should always be the case, hence #44355). Now, let go of control; both of them are still printing (expected). Now, let go of Z. "Ctrl Z" is still printing... ??? Nothing is currently pressed on the keyboard and it is still printing.

The only way to stop it is by pressing Ctrl Z again. This does not happen in current master.

41526-MRP.zip

This is tangentially related to #44355... it is trying to solve a different issue though, and does not solve that one.

@Lunatoid Lunatoid marked this pull request as draft February 3, 2021 19:07
@akien-mga
Copy link
Member

Closing as this was found to cause issues and was not updated further.

I checked and the linked issue is still valid in 4.0 RC 1 though, so that might be something to look into for a future release.

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

Successfully merging this pull request may close these issues.

[Modifier + Key] action is fired when pressing Key without modifier
5 participants