# Skip key down event if preceded by its key equivalent version \(\#2692\) · gitcafe/zed

[View on GitCafe](https://git.cafe/gitcafe/zed/commit/79ece8a86e9d8a2857cfb05b34a319434d076dd6)

Repository: [gitcafe/zed](https://git.cafe/gitcafe/zed)

Visibility: public

Requested revision: 79ece8a86e9d8a2857cfb05b34a319434d076dd6

Requested commit: 79ece8a86e9d8a2857cfb05b34a319434d076dd6

Commit: 79ece8a86e9d8a2857cfb05b34a319434d076dd6

Tree: 3a9a6f83beebf244e711553bba0b8be21922bc94

Author: Antonio Scandurra

Committer: GitHub

## Message

```
Skip key down event if preceded by its key equivalent version (#2692)

Fixes
https://linear.app/zed-industries/issue/Z-2552/pressing-two-keystrokes-in-rapid-succession-ignores-the-latter

Previously, we would only track whether the previous key down event was
a key equivalent. However, this could cause issues when pressing certain
keystrokes in rapid succession, e.g.:

- Pressing `shift-right` (to select a character, dispatched as a key
equivalent)
- Pressing a character (with or without `shift` held down, dispatched as
a key down)

This would cause GPUI to ignore the second event because it was preceded
by a key equivalent event. With this commit, we track the last key
equivalent event, and skip the key down event only if it matches the
last key equivalent event.

Release Notes:

- Fixed a bug that could cause certain keystrokes performed in rapid
succession to incorrectly get ignored.
```

## Parents

- [4ab2b8b24ba61d9be36ca21e728f776b3eb406ce](https://git.cafe/gitcafe/zed/commit/4ab2b8b24ba61d9be36ca21e728f776b3eb406ce?format=markdown)

- [318deed25b4bad1c0d0cfc29749a50a06a87590b](https://git.cafe/gitcafe/zed/commit/318deed25b4bad1c0d0cfc29749a50a06a87590b?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zed/tree/79ece8a86e9d8a2857cfb05b34a319434d076dd6?format=markdown)
