-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2169 from iced-rs/update-winit
Update `winit` to `0.29`
- Loading branch information
Showing
35 changed files
with
1,875 additions
and
1,234 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
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 |
---|---|---|
@@ -1,8 +1,11 @@ | ||
//! Listen to keyboard events. | ||
pub mod key; | ||
|
||
mod event; | ||
mod key_code; | ||
mod location; | ||
mod modifiers; | ||
|
||
pub use event::Event; | ||
pub use key_code::KeyCode; | ||
pub use key::Key; | ||
pub use location::Location; | ||
pub use modifiers::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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,34 +1,41 @@ | ||
use super::{KeyCode, Modifiers}; | ||
use crate::keyboard::{Key, Location, Modifiers}; | ||
use crate::SmolStr; | ||
|
||
/// A keyboard event. | ||
/// | ||
/// _**Note:** This type is largely incomplete! If you need to track | ||
/// additional events, feel free to [open an issue] and share your use case!_ | ||
/// | ||
/// [open an issue]: https://github.com/iced-rs/iced/issues | ||
#[derive(Debug, Clone, Copy, PartialEq, Eq)] | ||
#[derive(Debug, Clone, PartialEq, Eq)] | ||
pub enum Event { | ||
/// A keyboard key was pressed. | ||
KeyPressed { | ||
/// The key identifier | ||
key_code: KeyCode, | ||
/// The key pressed. | ||
key: Key, | ||
|
||
/// The state of the modifier keys | ||
/// The location of the key. | ||
location: Location, | ||
|
||
/// The state of the modifier keys. | ||
modifiers: Modifiers, | ||
|
||
/// The text produced by the key press, if any. | ||
text: Option<SmolStr>, | ||
}, | ||
|
||
/// A keyboard key was released. | ||
KeyReleased { | ||
/// The key identifier | ||
key_code: KeyCode, | ||
/// The key released. | ||
key: Key, | ||
|
||
/// The state of the modifier keys | ||
/// The location of the key. | ||
location: Location, | ||
|
||
/// The state of the modifier keys. | ||
modifiers: Modifiers, | ||
}, | ||
|
||
/// A unicode character was received. | ||
CharacterReceived(char), | ||
|
||
/// The keyboard modifiers have changed. | ||
ModifiersChanged(Modifiers), | ||
} |
Oops, something went wrong.