pub struct PointerProperties { /* private fields */ }Expand description
Describes a pointer’s values, typically at the time of a pointer event
Implementations§
Source§impl PointerProperties
impl PointerProperties
Sourcepub fn builder() -> PointerPropertiesBuilder<((), (), (), (), (), (), (), (), ())>
pub fn builder() -> PointerPropertiesBuilder<((), (), (), (), (), (), (), (), ())>
Create a builder for building PointerProperties.
On the builder, call .coordinates(...), .held_buttons(...), .id(...), .dimensions(...)(optional), .pressure(...)(optional), .tangential_pressure(...)(optional), .orientation(...)(optional), .pointer_type(...), .is_primary(...) to set the values of the fields.
Finally, call .build() to create the instance of PointerProperties.
Source§impl PointerProperties
impl PointerProperties
Sourcepub fn coordinates(&self) -> &Coordinates
pub fn coordinates(&self) -> &Coordinates
Coordinates in user interface
Pointer buttons held at time of event
Sourcepub fn dimensions(&self) -> Size2D<f64, Pixels>
pub fn dimensions(&self) -> Size2D<f64, Pixels>
Dimensions of pointer
Sourcepub fn pressure(&self) -> f64
pub fn pressure(&self) -> f64
The normalized pressure of the pointer input in the range of [0,1]
0 and 1 represent the minimum and maximum pressure the hardware is capable of detecting, respectively.
Sourcepub fn tangential_pressure(&self) -> f64
pub fn tangential_pressure(&self) -> f64
The normalized tangential pressure of pointer in the range of [-1,1]
Typically set by an additional control (e.g. a finger wheel on an airbrush stylus). Also known as barrel pressure.
0 is the neutral position of the control. Note that some hardware may only support positive values in the range of [0,1]
Sourcepub fn orientation(&self) -> &PointerOrientation
pub fn orientation(&self) -> &PointerOrientation
The pointer’s orientation (tilt or spherical angles, and twist)
Sourcepub fn pointer_type(&self) -> PointerType
pub fn pointer_type(&self) -> PointerType
The device type
Sourcepub fn is_primary(&self) -> bool
pub fn is_primary(&self) -> bool
In a multi-pointer (e.g. multi-touch) scenario, used to identify a master pointer amongst the set of active pointers for each pointer type.
- At any given time, there can be at most one primary pointer for each pointer type.
- The first pointer to become active for a particular pointer type (e.g. the first finger to touch the screen in a multi-touch interaction) becomes the primary pointer for that pointer type.
Trait Implementations§
Source§impl Clone for PointerProperties
impl Clone for PointerProperties
Source§fn clone(&self) -> PointerProperties
fn clone(&self) -> PointerProperties
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more