-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
8e9339e
commit 395671a
Showing
12 changed files
with
630 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
tauri: 'minor:feat' | ||
--- | ||
|
||
Expose window keyboard events from `tao`, as `WindowEvent::KeyboardInput`. |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
use serde::{Deserialize, Serialize}; | ||
|
||
pub use keyboard_types::{Code, Key, KeyState, Location, Modifiers}; | ||
|
||
/// Keyboard events are issued for all pressed and released keys. | ||
#[derive(Clone, Debug, Default, Eq, Hash, PartialEq, Serialize, Deserialize)] | ||
pub struct KeyboardEvent { | ||
/// Whether the key is pressed or released. | ||
pub state: KeyState, | ||
/// Logical key value. | ||
pub key: Key, | ||
/// Physical key position. | ||
pub code: Code, | ||
/// Location for keys with multiple instances on common keyboards. | ||
pub location: Location, | ||
/// True if the key is currently auto-repeated. | ||
pub repeat: bool, | ||
} | ||
|
||
impl KeyboardEvent { | ||
pub fn is_down(&self) -> bool { | ||
self.state == KeyState::Down | ||
} | ||
|
||
pub fn is_up(&self) -> bool { | ||
self.state == KeyState::Up | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
// Copyright 2019-2024 Tauri Programme within The Commons Conservancy | ||
// SPDX-License-Identifier: Apache-2.0 | ||
// SPDX-License-Identifier: MIT | ||
|
||
//! Types and functions related to keyboard input. | ||
pub use tauri_runtime::keyboard::{Code, Key, KeyState, KeyboardEvent, Location, Modifiers}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters