mirror of
https://github.com/slint-ui/slint.git
synced 2025-10-01 06:11:16 +00:00
feat: Add Key.Space to Key namespace. (#4311)
This commit is contained in:
parent
9b7a9b3f77
commit
807a233849
3 changed files with 3 additions and 3 deletions
|
@ -41,6 +41,7 @@ against the constants below.
|
|||
- **`ControlR`**
|
||||
- **`Meta`**
|
||||
- **`MetaR`**
|
||||
- **`Space`**
|
||||
- **`UpArrow`**
|
||||
- **`DownArrow`**
|
||||
- **`LeftArrow`**
|
||||
|
|
|
@ -287,9 +287,6 @@ impl EventLoopState {
|
|||
match key_code {
|
||||
$($(winit::keyboard::Key::Named(winit::keyboard::NamedKey::$winit) $(if event.location == winit::keyboard::KeyLocation::$pos)? => $char.into(),)*)*
|
||||
winit::keyboard::Key::Character(str) => str.as_str().into(),
|
||||
// Space is handled separately: When pressed, event.text would be Some(" ") and all is well. But when released,
|
||||
// event.text is always empty, so we'd never produce a release event.
|
||||
winit::keyboard::Key::Named(winit::keyboard::NamedKey::Space) => " ".into(),
|
||||
_ => {
|
||||
if let Some(text) = &event.text {
|
||||
text.as_str().into()
|
||||
|
|
|
@ -47,6 +47,8 @@ macro_rules! for_each_special_keys {
|
|||
'\u{0017}' # Meta # Qt_Key_Key_Meta # Super(Left) # Meta_L ;
|
||||
'\u{0018}' # MetaR # # Super(Right) # Meta_R ;
|
||||
|
||||
'\u{0020}' # Space # Qt_Key_Key_Space # Space # space ;
|
||||
|
||||
'\u{F700}' # UpArrow # Qt_Key_Key_Up # ArrowUp # Up ;
|
||||
'\u{F701}' # DownArrow # Qt_Key_Key_Down # ArrowDown # Down ;
|
||||
'\u{F702}' # LeftArrow # Qt_Key_Key_Left # ArrowLeft # Left ;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue