pub struct PointerData {Show 36 fields
pub view_id: ViewId,
pub embedder_id: i64,
pub time_stamp: Duration,
pub change: PointerChange,
pub kind: PointerDeviceKind,
pub signal_kind: Option<PointerSignalKind>,
pub device: i64,
pub pointer_identifier: i64,
pub physical_x: f64,
pub physical_y: f64,
pub physical_delta_x: f64,
pub physical_delta_y: f64,
pub buttons: i64,
pub obscured: bool,
pub synthesized: bool,
pub pressure: f64,
pub pressure_min: f64,
pub pressure_max: f64,
pub distance: f64,
pub distance_max: f64,
pub size: f64,
pub radius_major: f64,
pub radius_minor: f64,
pub radius_min: f64,
pub radius_max: f64,
pub orientation: f64,
pub tilt: f64,
pub platform_data: i64,
pub scroll_delta_x: f64,
pub scroll_delta_y: f64,
pub pan_x: f64,
pub pan_y: f64,
pub pan_delta_x: f64,
pub pan_delta_y: f64,
pub scale: f64,
pub rotation: f64,
}Expand description
Information about the state of a pointer.
Fields§
§view_id: ViewIdThe ID of the crate::View this pointer event originated from.
embedder_id: i64Unique identifier that ties the pointer event to the embedder event that created it.
No two pointer events can have the same embedder_id. This is different
from pointer_identifier - used for hit-testing, whereas embedder_id is
used to identify the platform event.
time_stamp: DurationTime of event dispatch, relative to an arbitrary timeline.
change: PointerChangeHow the pointer has changed since the last report.
kind: PointerDeviceKindThe kind of input device for which the event was generated.
signal_kind: Option<PointerSignalKind>The kind of signal for a pointer signal event.
device: i64Unique identifier for the pointing device, reused across interactions.
pointer_identifier: i64Unique identifier for the pointer.
This field changes for each new pointer down event. Framework uses this identifier to determine hit test result.
physical_x: f64X coordinate of the position of the pointer, in physical pixels in the global coordinate space.
physical_y: f64Y coordinate of the position of the pointer, in physical pixels in the global coordinate space.
physical_delta_x: f64The distance of pointer movement on X coordinate in physical pixels.
physical_delta_y: f64The distance of pointer movement on Y coordinate in physical pixels.
Bit field using the *Button constants (primaryMouseButton,
secondaryStylusButton, etc). For example, if this has the value 6 and the
kind is PointerDeviceKind::InvertedStylus, then this indicates an
upside-down stylus with both its primary and secondary buttons pressed.
obscured: boolSet if an application from a different security domain is in any way obscuring this application’s window. (Aspirational; not currently implemented.)
synthesized: boolSet if this pointer data was synthesized by pointer data packet converter. pointer data packet converter will synthesize additional pointer datas if the input sequence of pointer data is illegal.
For example, a down pointer data will be synthesized if the converter receives a move pointer data while the pointer is not previously down.
pressure: f64The pressure of the touch as a number ranging from 0.0, indicating a touch with no discernible pressure, to 1.0, indicating a touch with “normal” pressure, and possibly beyond, indicating a stronger touch. For devices that do not detect pressure (e.g. mice), returns 1.0.
pressure_min: f64The minimum value that pressure can return for this pointer. For devices
that do not detect pressure (e.g. mice), returns 1.0. This will always be
a number less than or equal to 1.0.
pressure_max: f64The maximum value that pressure can return for this pointer. For devices
that do not detect pressure (e.g. mice), returns 1.0. This will always be
a greater than or equal to 1.0.
distance: f64The distance of the detected object from the input surface (e.g. the distance of a stylus or finger from a touch screen), in arbitrary units on an arbitrary (not necessarily linear) scale. If the pointer is down, this is 0.0 by definition.
distance_max: f64The maximum value that a distance can return for this pointer. If this input device cannot detect “hover touch” input events, then this will be 0.0.
size: f64The area of the screen being pressed, scaled to a value between 0 and 1. The value of size can be used to determine fat touch events. This value is only set on Android, and is a device specific approximation within the range of detectable values. So, for example, the value of 0.1 could mean a touch with the tip of the finger, 0.2 a touch with full finger, and 0.3 the full palm.
radius_major: f64The radius of the contact ellipse along the major axis, in logical pixels.
radius_minor: f64The radius of the contact ellipse along the minor axis, in logical pixels.
radius_min: f64The minimum value that could be reported for radiusMajor and radiusMinor for this pointer, in logical pixels.
radius_max: f64The maximum value that could be reported for radiusMajor and radiusMinor for this pointer, in logical pixels.
orientation: f64For PointerDeviceKind::Touch events:
The angle of the contact ellipse, in radius in the range:
-pi/2 < orientation <= pi/2
…giving the angle of the major axis of the ellipse with the y-axis (negative angles indicating an orientation along the top-left / bottom-right diagonal, positive angles indicating an orientation along the top-right / bottom-left diagonal, and zero indicating an orientation parallel with the y-axis).
For PointerDeviceKind::Stylus and PointerDeviceKind::InvertedStylus events:
The angle of the stylus, in radians in the range:
-pi < orientation <= pi
…giving the angle of the axis of the stylus projected onto the input surface, relative to the positive y-axis of that surface (thus 0.0 indicates the stylus, if projected onto that surface, would go from the contact point vertically up in the positive y-axis direction, pi would indicate that the stylus would go down in the negative y-axis direction; pi/4 would indicate that the stylus goes up and to the right, -pi/2 would indicate that the stylus goes to the left, etc).
tilt: f64For PointerDeviceKind::Stylus and PointerDeviceKind::InvertedStylus events:
The angle of the stylus, in radians in the range:
0 <= tilt <= pi/2
…giving the angle of the axis of the stylus, relative to the axis perpendicular to the input surface (thus 0.0 indicates the stylus is orthogonal to the plane of the input surface, while pi/2 indicates that the stylus is flat on that surface).
platform_data: i64Opaque platform-specific data associated with the event.
scroll_delta_x: f64For events with signalKind of PointerSignalKind::Scroll:
The amount to scroll in the x direction, in physical pixels.
scroll_delta_y: f64For events with signalKind of PointerSignalKind::Scroll:
The amount to scroll in the y direction, in physical pixels.
pan_x: f64For events with change of PointerChange::PanZoomUpdate:
The current panning magnitude of the pan/zoom in the x direction, in physical pixels.
pan_y: f64For events with change of PointerChange::PanZoomUpdate:
The current panning magnitude of the pan/zoom in the y direction, in physical pixels.
pan_delta_x: f64For events with change of PointerChange::PanZoomUpdate:
The difference in panning of the pan/zoom in the x direction since the latest panZoomUpdate event, in physical pixels.
pan_delta_y: f64For events with change of PointerChange::PanZoomUpdate:
The difference in panning of the pan/zoom in the y direction since the last panZoomUpdate event, in physical pixels.
scale: f64For events with change of PointerChange::PanZoomUpdate:
The current scale of the pan/zoom (unitless), with 1.0 as the initial scale.
rotation: f64For events with change of PointerChange::PanZoomUpdate:
The current angle of the pan/zoom in radians, with 0.0 as the initial angle.
Implementations§
Source§impl PointerData
impl PointerData
Sourcepub fn to_string_full(&self) -> String
pub fn to_string_full(&self) -> String
Returns a complete textual description of the information in this object.
Trait Implementations§
Source§impl Clone for PointerData
impl Clone for PointerData
Source§fn clone(&self) -> PointerData
fn clone(&self) -> PointerData
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more