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 e6b8126
Show file tree
Hide file tree
Showing 5 changed files with 1,295 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 location::Location;
pub use modifiers::Modifiers;
pub use physical_key::{KeyCode, NativeKey, NativeKeyCode, PhysicalKey};
7 changes: 7 additions & 0 deletions core/src/keyboard/event.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
use crate::keyboard::physical_key::PhysicalKey;
use crate::keyboard::{Key, Location, Modifiers};
use crate::SmolStr;

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 e6b8126

Please sign in to comment.