| Crates.io | key-names |
| lib.rs | key-names |
| version | 3.0.0 |
| created_at | 2025-02-05 16:43:12.492993+00 |
| updated_at | 2025-02-06 03:15:13.855292+00 |
| description | Platform-aware keyboard key name handling for Rust applications |
| homepage | |
| repository | https://github.com/HactarCE/key-names |
| max_upload_size | |
| id | 1544300 |
| size | 90,923 |
Platform-aware keyboard key names for Rust applications. This crate is a fork of keyboard-keynames that adds a few extra features including winit integration.
Features:
This crate currently queries the keyboard layout only on Windows and Linux (X11 and Wayland). On macOS and web, there is instead a hard-coded table based on the US QWERTY layout. I would love a PR that adds support for querying the layout on either of these.
Run cargo run --example all_keys to see the key names produced by this library.
| Platform | Modifier names and order |
|---|---|
| Windows | Ctrl + Shift + Alt + Win + ... |
| Linux | Ctrl + Shift + Alt + Super + ... |
| macOS | Ctrl + Option + Shift + Cmd + ... |
| Web | Ctrl + Shift + Alt + Super + ... |
Bugfix PRs welcome! Before investing time & effort into a new feature, it might be good to open an issue to discuss. I made this crate initially for the needs of Hyperspeedcube, and I'm open to adding more features if people would find it useful and it's possible to support cross-platform.
Also, if anyone knows how to set up Cargo.toml to force-enable the winit feature on web, please submit a PR!