Skip to main content

PointerPointProperties

Struct PointerPointProperties 

Source
pub struct PointerPointProperties {
Show 14 fields pub contact_rect: Rect, pub is_left_button_pressed: bool, pub is_middle_button_pressed: bool, pub is_right_button_pressed: bool, pub is_x_button_1_pressed: bool, pub is_x_button_2_pressed: bool, pub is_barrel_button_pressed: bool, pub is_eraser: bool, pub is_inverted: bool, pub twist: f32, pub pressure: f32, pub x_tilt: f32, pub y_tilt: f32, pub pointer_update_kind: PointerUpdateKind,
}
Expand description

Provides extended properties for a pointer point.

Fields§

§contact_rect: Rect

The bounding rectangle of the contact area (typically from touch input).

§is_left_button_pressed: bool

Whether the pointer input was triggered by the primary action mode of an input device.

§is_middle_button_pressed: bool

Whether the pointer input was triggered by the tertiary action mode of an input device.

§is_right_button_pressed: bool

Whether the pointer input was triggered by the secondary action mode (if supported) of an input device.

§is_x_button_1_pressed: bool

Whether the pointer input was triggered by the first extended mouse button (XButton1).

§is_x_button_2_pressed: bool

Whether the pointer input was triggered by the second extended mouse button (XButton2).

§is_barrel_button_pressed: bool

Whether the barrel button of the pen/stylus device is pressed.

§is_eraser: bool

Whether the input is from a pen eraser.

§is_inverted: bool

Whether the digitizer input is from an inverted pen.

§twist: f32

The clockwise rotation in degrees of a pen device around its own major axis (such as when the user spins the pen in their fingers). A value between 0.0 and 359.0 in degrees of rotation; the default value is 0.0.

§pressure: f32

A value that indicates the force that the pointer device (typically a pen/stylus) exerts on the surface of the digitizer. A value from 0 to 1.0; the default value is 0.5.

§x_tilt: f32

The plane angle between the Y-Z plane and the plane that contains the Y axis and the axis of the input device (typically a pen/stylus). The value is 0.0 when the finger or pen is perpendicular to the digitizer surface, between 0.0 and 90.0 when tilted to the right of perpendicular, and between 0.0 and -90.0 when tilted to the left of perpendicular. The default value is 0.0.

§y_tilt: f32

The plane angle between the X-Z plane and the plane that contains the X axis and the axis of the input device (typically a pen/stylus). The value is 0.0 when the finger or pen is perpendicular to the digitizer surface, between 0.0 and 90.0 when tilted towards the user, and between 0.0 and -90.0 when tilted away from the user. The default value is 0.0.

§pointer_update_kind: PointerUpdateKind

The kind of pointer state change.

Implementations§

Source§

impl PointerPointProperties

Source

pub const NONE: PointerPointProperties

The default properties: nothing pressed.

Source

pub fn new(modifiers: RawInputModifiers, kind: PointerUpdateKind) -> Self

Creates properties from raw input modifiers and the kind of state change.

Source

pub fn with_pen_state( modifiers: RawInputModifiers, kind: PointerUpdateKind, twist: f32, pressure: f32, x_tilt: f32, y_tilt: f32, ) -> Self

Creates properties with pen state.

Source

pub fn with_pen_state_and_contact_rect( modifiers: RawInputModifiers, kind: PointerUpdateKind, twist: f32, pressure: f32, x_tilt: f32, y_tilt: f32, contact_rect: Rect, ) -> Self

Creates properties with pen state and a contact rectangle.

Source

pub fn from_raw_point( modifiers: RawInputModifiers, kind: PointerUpdateKind, raw_point: RawPointerPoint, ) -> Self

Creates properties from a raw pointer point.

Source

pub fn based_on( based_on: PointerPointProperties, raw_point: RawPointerPoint, ) -> Self

Creates the properties of an intermediate point: the button state of based_on with the pen state of a raw pointer point.

Trait Implementations§

Source§

impl Clone for PointerPointProperties

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for PointerPointProperties

Source§

impl Debug for PointerPointProperties

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for PointerPointProperties

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl PartialEq for PointerPointProperties

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for PointerPointProperties

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> AnyValue for T
where T: PartialEq + 'static,

Source§

fn any_value_as_any(&self) -> &(dyn Any + 'static)

Source§

fn any_value_eq(&self, other: &(dyn AnyValue + 'static)) -> bool

Source§

fn any_value_type_name(&self) -> &'static str

Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> ClassDefaults for T
where T: ?Sized,

Source§

fn static_constructor()

The static constructor of a type: work done once per thread, after the properties of the type are registered and before its first instance exists (class handlers, affects_render, metadata overrides). Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> PropertyValue for T
where T: Clone + PartialEq + 'static,

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.