kbd-iced
kbd bridge for iced — converts key events and modifiers to kbd types.
This lets GUI key events (from iced) and global hotkey events (from kbd-global) feed into the same Dispatcher. Useful in iced apps that want both in-window shortcuts and system-wide hotkeys handled through a single hotkey registry.
Iced defines its own W3C-derived key types: key::Code for physical key positions and key::Physical wrapping Code with an unidentified fallback. This crate only converts physical keys — they are layout-independent and match kbd's model.
[]
= "0.1"
= "0.1"
Extension traits
IcedKeyExt— converts an icedkey::Codeorkey::Physicalto akbd::KeyIcedModifiersExt— converts icedModifiersto aVec<Modifier>IcedEventExt— converts an iced keyboardEventto akbd::Hotkey
Usage
use ;
use *;
use ;
let key = KeyA.to_key;
assert_eq!;
let mods = CTRL.to_modifiers;
assert_eq!;
Key mapping
| iced | kbd | Notes |
|---|---|---|
Code::KeyA – Code::KeyZ |
Key::A – Key::Z |
Letters |
Code::Digit0 – Code::Digit9 |
Key::DIGIT0 – Key::DIGIT9 |
Digits |
Code::F1 – Code::F35 |
Key::F1 – Key::F35 |
Function keys |
Code::Numpad0 – Code::Numpad9 |
Key::NUMPAD0 – Key::NUMPAD9 |
Numpad |
Code::Enter, Code::Escape, … |
Key::ENTER, Key::ESCAPE, … |
Navigation / editing |
Code::ControlLeft, … |
Key::CONTROL_LEFT, … |
Modifier keys as triggers |
Code::SuperLeft / Code::Meta |
Key::META_LEFT |
iced's Super = kbd's Meta |
Code::MediaPlayPause, … |
Key::MEDIA_PLAY_PAUSE, … |
Media keys |
Code::BrowserBack, … |
Key::BROWSER_BACK, … |
Browser keys |
Physical::Unidentified(_) |
None |
No mapping possible |
Modifier mapping
| iced | kbd |
|---|---|
CTRL |
Modifier::Ctrl |
SHIFT |
Modifier::Shift |
ALT |
Modifier::Alt |
LOGO |
Modifier::Super |
License
kbd-iced is licensed under the MIT license. See the LICENSE file for more information.