# ｗindows: Only call \`TranslateMessage\` when we can't handle the event \(\#32166\) · gitcafe/zed

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

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

Visibility: public

Requested revision: 5b9d3ea097b173202964dbdf09d6a9568d0fbab0

Requested commit: 5b9d3ea097b173202964dbdf09d6a9568d0fbab0

Commit: 5b9d3ea097b173202964dbdf09d6a9568d0fbab0

Tree: 78e5f4d5b8c8c8fa70fcec3b052113050cf0d328

Author: 张小白

Committer: GitHub

## Message

```
ｗindows: Only call `TranslateMessage` when we can't handle the event (#32166)

This PR improves key handling on Windows by moving the
`TranslateMessage` call from the message loop to after we handled
`WM_KEYDOWN`. This brings Windows behavior more in line with macOS and
gives us finer control over key events. As a result, Vim keybindings now
work properly even when an IME is active. The trade-off is that it might
introduce a slight delay in text input.


Release Notes:

- N/A
```

## Parents

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

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