pub struct TouchedArgs {Show 13 fields
pub timestamp: DInstant,
pub window_id: WindowId,
pub device_id: Option<DeviceId>,
pub touch: TouchId,
pub touch_propagation: EventPropagationHandle,
pub position: DipPoint,
pub force: Option<TouchForce>,
pub phase: TouchPhase,
pub hits: HitTestInfo,
pub prev_target: Option<InteractionPath>,
pub target: Option<InteractionPath>,
pub prev_capture: Option<CaptureInfo>,
pub capture: Option<CaptureInfo>,
/* private fields */
}
Expand description
Arguments for TOUCHED_EVENT
.
Fields§
§timestamp: DInstant
Instant the event happened.
window_id: WindowId
Id of window that received the event.
device_id: Option<DeviceId>
Id of device that generated the event.
touch: TouchId
Identify the touch contact or finger.
Multiple points of contact can happen in the same device at the same time, this ID identifies each uninterrupted contact. IDs are unique only among other concurrent touches on the same device, after a touch is ended an ID may be reused.
touch_propagation: EventPropagationHandle
Handle across the lifetime of touch
.
See TouchInputArgs::touch_propagation
for more details.
position: DipPoint
Center of the touch in the window’s content area.
force: Option<TouchForce>
Touch pressure force and angle.
phase: TouchPhase
Touch phase that caused the contact gain or loss with the widget.
hits: HitTestInfo
Hit-test result for the touch point in the window.
prev_target: Option<InteractionPath>
Previous top-most hit before the touch moved.
target: Option<InteractionPath>
Full path to the top-most hit in hits
.
prev_capture: Option<CaptureInfo>
Previous pointer capture.
capture: Option<CaptureInfo>
Current pointer capture.
Implementations§
source§impl TouchedArgs
impl TouchedArgs
sourcepub fn new(
timestamp: impl Into<DInstant>,
propagation_handle: EventPropagationHandle,
window_id: impl Into<WindowId>,
device_id: impl Into<Option<DeviceId>>,
touch: impl Into<TouchId>,
touch_propagation: impl Into<EventPropagationHandle>,
position: impl Into<DipPoint>,
force: impl Into<Option<TouchForce>>,
phase: impl Into<TouchPhase>,
hits: impl Into<HitTestInfo>,
prev_target: impl Into<Option<InteractionPath>>,
target: impl Into<Option<InteractionPath>>,
prev_capture: impl Into<Option<CaptureInfo>>,
capture: impl Into<Option<CaptureInfo>>,
) -> Self
pub fn new( timestamp: impl Into<DInstant>, propagation_handle: EventPropagationHandle, window_id: impl Into<WindowId>, device_id: impl Into<Option<DeviceId>>, touch: impl Into<TouchId>, touch_propagation: impl Into<EventPropagationHandle>, position: impl Into<DipPoint>, force: impl Into<Option<TouchForce>>, phase: impl Into<TouchPhase>, hits: impl Into<HitTestInfo>, prev_target: impl Into<Option<InteractionPath>>, target: impl Into<Option<InteractionPath>>, prev_capture: impl Into<Option<CaptureInfo>>, capture: impl Into<Option<CaptureInfo>>, ) -> Self
New args from values that convert into the argument types.
sourcepub fn now(
window_id: impl Into<WindowId>,
device_id: impl Into<Option<DeviceId>>,
touch: impl Into<TouchId>,
touch_propagation: impl Into<EventPropagationHandle>,
position: impl Into<DipPoint>,
force: impl Into<Option<TouchForce>>,
phase: impl Into<TouchPhase>,
hits: impl Into<HitTestInfo>,
prev_target: impl Into<Option<InteractionPath>>,
target: impl Into<Option<InteractionPath>>,
prev_capture: impl Into<Option<CaptureInfo>>,
capture: impl Into<Option<CaptureInfo>>,
) -> Self
pub fn now( window_id: impl Into<WindowId>, device_id: impl Into<Option<DeviceId>>, touch: impl Into<TouchId>, touch_propagation: impl Into<EventPropagationHandle>, position: impl Into<DipPoint>, force: impl Into<Option<TouchForce>>, phase: impl Into<TouchPhase>, hits: impl Into<HitTestInfo>, prev_target: impl Into<Option<InteractionPath>>, target: impl Into<Option<InteractionPath>>, prev_capture: impl Into<Option<CaptureInfo>>, capture: impl Into<Option<CaptureInfo>>, ) -> Self
Arguments for event that happened now (INSTANT.now
).
source§impl TouchedArgs
impl TouchedArgs
sourcepub fn capture_allows(&self) -> bool
pub fn capture_allows(&self) -> bool
sourcepub fn is_touch_move(&self) -> bool
pub fn is_touch_move(&self) -> bool
Event caused by the touch position moving over/out of the widget bounds.
sourcepub fn is_widget_move(&self) -> bool
pub fn is_widget_move(&self) -> bool
Event caused by the widget moving under/out of the mouse position.
sourcepub fn is_capture_change(&self) -> bool
pub fn is_capture_change(&self) -> bool
Event caused by a pointer capture change.
sourcepub fn is_touch_enter(&self) -> bool
pub fn is_touch_enter(&self) -> bool
Returns true
if the WIDGET
was not touched, but now is.
sourcepub fn is_touch_leave(&self) -> bool
pub fn is_touch_leave(&self) -> bool
Returns true
if the WIDGET
was touched, but now isn’t.
sourcepub fn is_touch_enter_enabled(&self) -> bool
pub fn is_touch_enter_enabled(&self) -> bool
Returns true
if the WIDGET
was not touched or was disabled, but now is touched and enabled.
sourcepub fn is_touch_leave_enabled(&self) -> bool
pub fn is_touch_leave_enabled(&self) -> bool
Returns true
if the WIDGET
was touched and enabled, but now is not touched or is disabled.
sourcepub fn is_touch_enter_disabled(&self) -> bool
pub fn is_touch_enter_disabled(&self) -> bool
Returns true
if the WIDGET
was not touched or was enabled, but now is touched and disabled.
sourcepub fn is_touch_leave_disabled(&self) -> bool
pub fn is_touch_leave_disabled(&self) -> bool
Returns true
if the WIDGET
was touched and disabled, but now is not touched or is enabled.
sourcepub fn was_touched(&self) -> bool
pub fn was_touched(&self) -> bool
Returns true
if the WIDGET
is in prev_target
and is allowed by the prev_capture
.
sourcepub fn is_touched(&self) -> bool
pub fn is_touched(&self) -> bool
sourcepub fn was_enabled(&self, widget_id: WidgetId) -> bool
pub fn was_enabled(&self, widget_id: WidgetId) -> bool
Returns true
if the widget was enabled in prev_target
.
sourcepub fn was_disabled(&self, widget_id: WidgetId) -> bool
pub fn was_disabled(&self, widget_id: WidgetId) -> bool
Returns true
if the widget was disabled in prev_target
.
sourcepub fn is_enabled(&self, widget_id: WidgetId) -> bool
pub fn is_enabled(&self, widget_id: WidgetId) -> bool
Returns true
if the widget is enabled in target
.
sourcepub fn is_disabled(&self, widget_id: WidgetId) -> bool
pub fn is_disabled(&self, widget_id: WidgetId) -> bool
Returns true
if the widget is disabled in target
.
Trait Implementations§
source§impl AnyEventArgs for TouchedArgs
impl AnyEventArgs for TouchedArgs
source§fn delivery_list(&self, list: &mut UpdateDeliveryList)
fn delivery_list(&self, list: &mut UpdateDeliveryList)
The prev_target
, target
and capture
.
source§fn clone_any(&self) -> Box<dyn AnyEventArgs>
fn clone_any(&self) -> Box<dyn AnyEventArgs>
source§fn propagation(&self) -> &EventPropagationHandle
fn propagation(&self) -> &EventPropagationHandle
source§impl Clone for TouchedArgs
impl Clone for TouchedArgs
source§fn clone(&self) -> TouchedArgs
fn clone(&self) -> TouchedArgs
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for TouchedArgs
impl Debug for TouchedArgs
Auto Trait Implementations§
impl Freeze for TouchedArgs
impl RefUnwindSafe for TouchedArgs
impl Send for TouchedArgs
impl Sync for TouchedArgs
impl Unpin for TouchedArgs
impl UnwindSafe for TouchedArgs
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more