Skip to content

fix(key-bindings): Handle overlapping key bindings correctly#2178

Merged
rkaraivanov merged 1 commit intomasterfrom
rkaraivanov/fix-overlapping-keys
Apr 7, 2026
Merged

fix(key-bindings): Handle overlapping key bindings correctly#2178
rkaraivanov merged 1 commit intomasterfrom
rkaraivanov/fix-overlapping-keys

Conversation

@rkaraivanov
Copy link
Copy Markdown
Member

Description

  • When multiple keys are pressed in quick succession, it's possible for their keydown events to overlap before the corresponding keyup events fire. This can lead to incorrect binding matches if the logic doesn't account for the current state of pressed keys.

The fix involves ensuring that the key event handling logic correctly identifies which keys are currently pressed and matches them against the defined bindings, even when overlaps occur.

  • Additionally, the skip logic is improved to prevent keys from getting stuck if the skip condition changes between keydown and keyup events.

Type of Change

  • Bug fix (non-breaking change that fixes an issue)

Testing

Added a test scenario covering the issue.

Checklist

  • My code follows the project's coding standards
  • I have tested my changes locally

- When multiple keys are pressed in quick succession,
it's possible for their keydown events to overlap before
the corresponding keyup events fire. This can lead to
incorrect binding matches if the logic doesn't account for
the current state of pressed keys.

The fix involves ensuring that the key event handling logic
correctly identifies which keys are currently pressed and
matches them against the defined bindings, even when overlaps occur.

- Additionally, the skip logic is improved to prevent keys from
getting stuck if the skip condition changes between keydown and keyup events.
@rkaraivanov rkaraivanov merged commit 8ddff70 into master Apr 7, 2026
7 checks passed
@rkaraivanov rkaraivanov deleted the rkaraivanov/fix-overlapping-keys branch April 7, 2026 10:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant