PointerEventArgs
struct · ferroui-base · v0.5.0
struct PointerEventArgs
Provides data for pointer events.
Members
newwith_previous_pointswith_platform_input_event_cookiepointertimestampplatform_input_event_cookiekey_modifiersget_positionget_current_pointget_intermediate_pointsprevent_gesture_recognitionproperties
new
fn new<T: ?Sized>(routed_event: Option<&RoutedEvent<T>>, source: impl Into<Nullable<FerroObject>>, pointer: Rc<dyn IPointer>, root_visual: Option<&Visual>, root_visual_position: Point, timestamp: u64, properties: PointerPointProperties, modifiers: KeyModifiers) -> Self
Creates pointer event args.
root_visual is the root of the tree that observed the event and
root_visual_position the position of the pointer in its
coordinates. timestamp is the platform time stamp of the input.
with_previous_points
fn with_previous_points(self: Self, previous_points: Option<IntermediatePoints>) -> Self
Adds the intermediate points of the event.
with_platform_input_event_cookie
fn with_platform_input_event_cookie(self: Self, cookie: Option<Rc<dyn Any>>) -> Self
Adds the platform's cookie for the input event.
pointer
fn pointer(self: &Self) -> &Rc<dyn IPointer>
The pointer that caused the event.
timestamp
fn timestamp(self: &Self) -> u64
The time when the pointer event occurred, as reported by the platform.
platform_input_event_cookie
fn platform_input_event_cookie(self: &Self) -> Option<&Rc<dyn Any>>
The platform's opaque cookie for the input event that caused this event, if any.
key_modifiers
fn key_modifiers(self: &Self) -> KeyModifiers
The key modifiers held down when the event occurred.
get_position
fn get_position(self: &Self, relative_to: Option<&Visual>) -> Point
Gets the pointer position relative to a control, or relative to the
root of the tree that observed the event when relative_to is
None.
get_current_point
fn get_current_point(self: &Self, relative_to: Option<&Visual>) -> PointerPoint
Returns the pointer point associated with the current event, positioned relative to a control.
get_intermediate_points
fn get_intermediate_points(self: &Self, relative_to: Option<&Visual>) -> Vec<PointerPoint>
Returns all points since the last relevant pointer event, positioned relative to a control. The last one is the current point.
prevent_gesture_recognition
fn prevent_gesture_recognition(self: &Self)
Prevents this event from being handled by other gesture recognizers in the route.
properties
fn properties(self: &Self) -> PointerPointProperties
The state of the pointer device at the time of the event.
Trait implementations
SendSyncFreezeUnsafeUnpinUnpinUnwindSafeRefUnwindSafeClassDefaultsBorrow<T>BorrowMut<T>CloneToUninitInto<U>From<T>TryInto<U>TryFrom<U>ReceiverAnyToOwnedErasedDestructorIntoEitherCloneDerefIRoutedEventArgsIKeyModifiersEventArgsMarkupTyped
Availability
Extracted for aarch64-apple-darwin. Cargo features are listed in the crate index.