pub trait HasPointerData: PointerInteraction {
// Required methods
fn pointer_id(&self) -> i32;
fn width(&self) -> i32;
fn height(&self) -> i32;
fn pressure(&self) -> f32;
fn tangential_pressure(&self) -> f32;
fn tilt_x(&self) -> i32;
fn tilt_y(&self) -> i32;
fn twist(&self) -> i32;
fn pointer_type(&self) -> String;
fn is_primary(&self) -> bool;
fn as_any(&self) -> &(dyn Any + 'static);
}Expand description
A trait for any object that has the data for a pointer event
Required Methods§
Sourcefn pointer_id(&self) -> i32
fn pointer_id(&self) -> i32
Gets the unique identifier of the pointer causing the event.
Sourcefn width(&self) -> i32
fn width(&self) -> i32
Gets the width (magnitude on the X axis), in CSS pixels, of the contact geometry of the pointer.
Sourcefn height(&self) -> i32
fn height(&self) -> i32
Gets the height (magnitude on the Y axis), in CSS pixels, of the contact geometry of the pointer.
Sourcefn pressure(&self) -> f32
fn pressure(&self) -> f32
Gets the normalized pressure of the pointer input in the range of 0 to 1,
Sourcefn tangential_pressure(&self) -> f32
fn tangential_pressure(&self) -> f32
Gets the normalized tangential pressure of the pointer input (also known as barrel pressure or cylinder stress) in the range -1 to 1,
Sourcefn tilt_x(&self) -> i32
fn tilt_x(&self) -> i32
Gets the plane angle (in degrees, in the range of -90 to 90) between the Y-Z plane and the plane containing both the transducer (e.g. pen stylus) axis and the Y axis.
Sourcefn tilt_y(&self) -> i32
fn tilt_y(&self) -> i32
Gets the plane angle (in degrees, in the range of -90 to 90) between the X-Z plane and the plane containing both the transducer (e.g. pen stylus) axis and the X axis.
Sourcefn twist(&self) -> i32
fn twist(&self) -> i32
Gets the clockwise rotation of the pointer (e.g. pen stylus) around its major axis in degrees, with a value in the range 0 to 359.The clockwise rotation of the pointer (e.g. pen stylus) around its major axis in degrees, with a value in the range 0 to 359.
Sourcefn pointer_type(&self) -> String
fn pointer_type(&self) -> String
Gets the device type that caused the event (mouse, pen, touch, etc.).
Sourcefn is_primary(&self) -> bool
fn is_primary(&self) -> bool
Gets if the pointer represents the primary pointer of this pointer type.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".