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

fix: don't clear ime_last_event when a key is UP #6388

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

psyclaudeZ
Copy link

Issue

When certain keys [1] are pressed and held before a previously held key is released, the key up event from the previously held key will prevent the new key from repeating. More details in #4061.

Approach

The immediate reason of this is that the key up event clears ime_last_event which subsequently clears ime_state hence breaks the logic guarded by this comment:

// ... if the current event
// is a repeat, and the IME previously generated
// `Acted`, we will assume that we're safe to replay
// that last action.

Since, IMO, IME events are generally associated with key being pressed down, I'm adding a simple check in key_common to prevent the event from being cleared by a key up event.

Technically there're other places that clear ime_last_event, but I'm limiting my change to the immediate blast radius of the issue for simplicity.

Test Plan

  1. cargo test --all
  2. Verified the said issue wouldn't happen anymore by holding k -> holding j -> releasing k.

[1] - b, f, j, m, p, q, v, x to be exact. The accent menu won't be loaded for these characters on macOS anyway.

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