Skip to content

Commit

Permalink
Expose physical keys
Browse files Browse the repository at this point in the history
  • Loading branch information
Exidex committed Jul 26, 2024
1 parent 5071e3d commit 02a84a0
Show file tree
Hide file tree
Showing 5 changed files with 894 additions and 1 deletion.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,5 @@ pkg/
Cargo.lock
dist/
traces/

.idea/
2 changes: 2 additions & 0 deletions core/src/keyboard.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,10 @@ pub mod key;
mod event;
mod location;
mod modifiers;
mod physical_key;

pub use event::Event;
pub use key::Key;
pub use physical_key::{PhysicalKey, KeyCode, NativeKey, NativeKeyCode};
pub use location::Location;
pub use modifiers::Modifiers;
7 changes: 7 additions & 0 deletions core/src/keyboard/event.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
use crate::keyboard::{Key, Location, Modifiers};

Check failure on line 1 in core/src/keyboard/event.rs

View workflow job for this annotation

GitHub Actions / all

Diff in /home/runner/work/iced/iced/core/src/keyboard/event.rs
use crate::keyboard::physical_key::PhysicalKey;
use crate::SmolStr;

/// A keyboard event.
Expand All @@ -14,6 +15,9 @@ pub enum Event {
/// The key pressed.
key: Key,

/// The physical key pressed.
physical_key: PhysicalKey,

/// The location of the key.
location: Location,

Expand All @@ -29,6 +33,9 @@ pub enum Event {
/// The key released.
key: Key,

/// The physical key released.
physical_key: PhysicalKey,

/// The location of the key.
location: Location,

Expand Down
Loading

0 comments on commit 02a84a0

Please sign in to comment.