Skip to content
This repository has been archived by the owner on Jul 15, 2024. It is now read-only.

Commit

Permalink
Merge pull request #110 from waywardmonkeys/improve-export-docs-point…
Browse files Browse the repository at this point in the history
…er-type

Export `MouseInfo`, `PenInfo`, `TouchInfo` structs.
  • Loading branch information
waywardmonkeys authored Jul 7, 2023
2 parents cc1df9d + 01f68ce commit e4d90af
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@
- Add wgpu triangle example ([#53] by [@lord])
- Add thread-safe app handle ([#90] by [@clavin])
- Updated AccessKit to 0.11 ([#108] by [@waywardmonkeys])
- Export `MouseInfo`, `PenInfo`, `TouchInfo` for `PointerType` values ([#110] by [@waywardmonkeys])

[@waywardmonkeys]: https://github.com/waywardmonkeys

[#108]: https://github.com/linebender/glazier/pull/108
[#110]: https://github.com/linebender/glazier/pull/108
3 changes: 2 additions & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,8 @@ pub use keyboard::{Code, IntoKey, KbKey, KeyEvent, KeyState, Location, Modifiers
pub use menu::Menu;
pub use mouse::{Cursor, CursorDesc, MouseButton, MouseButtons, MouseEvent};
pub use pointer::{
PenInclination, PointerButton, PointerButtons, PointerEvent, PointerId, PointerType,
MouseInfo, PenInclination, PenInfo, PointerButton, PointerButtons, PointerEvent, PointerId,
PointerType, TouchInfo,
};
pub use region::Region;
pub use scale::{Scalable, Scale, ScaledArea};
Expand Down
7 changes: 7 additions & 0 deletions src/pointer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -153,13 +153,20 @@ pub struct PenInfo {

impl PenInfo {}

/// Various properties of a touch event.
///
/// These follow the web [PointerEvents] specification fairly closely, so see those
/// documents for more context and nice pictures.
///
/// [PointerEvents]: (https://www.w3.org/TR/pointerevents3)
#[derive(Debug, Clone, PartialEq)]
pub struct TouchInfo {
pub contact_geometry: Size,
pub pressure: f32,
// TODO: Phase?
}

/// Various properties of a mouse event.
#[derive(Debug, Clone, PartialEq)]
pub struct MouseInfo {
pub wheel_delta: Vec2,
Expand Down

0 comments on commit e4d90af

Please sign in to comment.