pub struct InputSample {
pub position: LogicalPosition,
pub timestamp: Instant,
pub button_state: u8,
pub event_id: u64,
pub pressure: f32,
pub tilt: (f32, f32),
pub touch_radius: (f32, f32),
}Expand description
Single input sample with position and timestamp
Fields§
§position: LogicalPositionPosition in logical coordinates
timestamp: InstantTimestamp when this sample was recorded (from ExternalSystemCallbacks)
Mouse button state (bitfield: 0x01 = left, 0x02 = right, 0x04 = middle)
event_id: u64Unique, monotonic event ID for ordering (atomic counter)
pressure: f32Pen/stylus pressure (0.0 to 1.0, 0.5 = default for mouse)
tilt: (f32, f32)Pen/stylus tilt angles in degrees (x_tilt, y_tilt) Range: typically -90.0 to 90.0, (0.0, 0.0) = perpendicular
touch_radius: (f32, f32)Touch contact radius in logical pixels (width, height) For mouse input, this is (0.0, 0.0)
Trait Implementations§
Source§impl Clone for InputSample
impl Clone for InputSample
Source§fn clone(&self) -> InputSample
fn clone(&self) -> InputSample
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for InputSample
impl Debug for InputSample
Source§impl PartialEq for InputSample
impl PartialEq for InputSample
impl StructuralPartialEq for InputSample
Auto Trait Implementations§
impl Freeze for InputSample
impl RefUnwindSafe for InputSample
impl Send for InputSample
impl Sync for InputSample
impl Unpin for InputSample
impl UnwindSafe for InputSample
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more