-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Meta Issue: Keyboard input #1806
Description
There are a bunch of issues related to keyboard input on the issue tracker, but it's currently difficult to get an overview of currently open issues in a short amount of time.
By opening this issue, I hope to consolidate information about what's currently broken about keyboard input in Winit in one place.
Two issues which are of particular importance here are:
- A keyboard input model #753, where the API for individual keypresses is discussed.
There is some additional discussion in (PR) New keyboard API for Windows #1788, which tries to implement the API. - Tracking issue for IME / composition support #1497, where the IME API is discussed.
There has been a lot of progress on the implementation of the API discussed in #753, and there is now a PR moving all the backends (bar Redox) to the new API: #2662
This PR supersedes the previous backend-specific PRs:
- Windows: New keyboard API for Windows #1788 (merged)
- macOS: New keyboard API for macOS #1890
- WASM (web-sys): New keyboard API for the web #1888
- Linux: New keyboard API for Linux #1932
There are two milestones which track some issues related to keyboard input:
These milestones don't track all issues related to keyboard input, so here's a list of these untracked issues:
May be resolved by adoption of #753
| Issue | Platform | Notes |
|---|---|---|
| #440 | Linux | Panic when using optirun and typing dead keys. |
| #714 | macOS | ReceivedCharacter gets infinitely repeated under certain circumstances. |
| #734 | macOS | "in certain circumstances the Paste key is sent multiple times to the winit application." |
| #773 | Cross-platform | Ignoring keyboard input when IME is active. |
| #1208 | macOS | Might be another instance of a VirtualKeyCode not being delivered. |
| #1267 | macOS | Certain key combinations don't send ReceivedCharacter events. |
| #1272 | Cross-platform | Some platforms don't give you key release events if you press a key, then unfocus the window and then release the key. This is papered over by winit through synthesized keyboard events (WindowEvent::KeyboardInput.is_synthetic). |
| #1396 | macOS | ModifiersChanged isn't emitted in certain cases. |
| #1443 | Linux | DeviceEvent delivers a VirtualKeyCode while WindowEvent doesn't. |
| #1470 | macOS | No keyboard input through DeviceEvent on macOS. |
| #1488 | macOS | Key repeat is inconsistent. |
| #1656 | Linux | Shift+Alt produces the wrong virtual keycode on Alt "key down". |
Various bugs and requests for API changes
| Issue | Platform | Notes |
|---|---|---|
| #347 | Linux | Mutex issues & segfault when using IME. |
| #361 | Linux | DeviceEvent delivers a VirtualKeyCode while WindowEvent doesn't. |
| #477 | Cross-platform | ReceivedCharacter & Enter/Return. |
| #732 | Cross-platform | Proposal for an API to convert between ScanCode and VirtualKeyCode. |
| #756 | Cross-platform | ModifiersState should differentiate between "right Alt" and AltGr. |
| #788 | Linux | XIMPreeditPosition should be used instead of XIMPreeditNothing in a particular spot. |
| #1010 | Cross-platform | Request for a keyboard key state query API. |
| #1426 | Cross-platform | A request for a NumLock status query API. |
| #1452 | Cross-platform | ReceivedCharacter is not emitted while IME is active. |
| #1497 | Cross-platform | Tracking issue for CompositionEvent support. |
| #1768 | Web | Web hotkeys may need to be optionally allowed. |