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

feat: Added a flag to key press behavior to allow it to be inverted #2554

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

Nick-Munnich
Copy link
Contributor

@Nick-Munnich Nick-Munnich commented Oct 15, 2024

Currently if two of the same binding are pressed and then released, the first release will be treated as both keys being released.

This adds a new optional flag to the key press behavior invert-if-active causing the behavior to invert its function if the binding is already pressed:

  • If pressed and inverting key press is pressed, a release is triggered
  • If released and inverting key press is released, a press is triggered

This flag resolves this inconsistent behavior, but is marked as optional for backwards compatibility and as it is less intuitive.

It is also a quite useful interaction, in my opinion:

  • Quickly interrupting shift or a similar modifier
  • Toggle W on and press W to stay in place for reduced key holding when WASD gaming

EDIT: I have a feeling that this may interact poorly with combos. This is a note telling me to test that interaction in the future when I get around to it.

@Nick-Munnich Nick-Munnich requested review from a team as code owners October 15, 2024 11:21
@Nick-Munnich Nick-Munnich marked this pull request as draft October 15, 2024 23:12
@Nick-Munnich Nick-Munnich marked this pull request as ready for review October 16, 2024 07:56
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.

1 participant