Struct zng_ext_input::mouse::MouseInputArgs
source · pub struct MouseInputArgs {
pub timestamp: DInstant,
pub window_id: WindowId,
pub device_id: Option<DeviceId>,
pub button: MouseButton,
pub position: DipPoint,
pub modifiers: ModifiersState,
pub state: ButtonState,
pub hits: HitTestInfo,
pub target: InteractionPath,
pub capture: Option<CaptureInfo>,
pub is_click: bool,
/* private fields */
}
Expand description
MOUSE_INPUT_EVENT
arguments.
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.
Which mouse button generated the event.
position: DipPoint
Position of the mouse in the window’s content area.
modifiers: ModifiersState
What modifier keys where pressed when this event happened.
state: ButtonState
The state the button
was changed to.
hits: HitTestInfo
Hit-test result for the mouse point in the window.
target: InteractionPath
Full path to the top-most hit in hits
.
capture: Option<CaptureInfo>
Current pointer capture.
is_click: bool
If MOUSE_CLICK_EVENT
will notify because of this input.
The click event shares the same propagation handle as this event.
Implementations§
source§impl MouseInputArgs
impl MouseInputArgs
sourcepub fn new(
timestamp: impl Into<DInstant>,
propagation_handle: EventPropagationHandle,
window_id: impl Into<WindowId>,
device_id: impl Into<Option<DeviceId>>,
button: impl Into<MouseButton>,
position: impl Into<DipPoint>,
modifiers: impl Into<ModifiersState>,
state: impl Into<ButtonState>,
hits: impl Into<HitTestInfo>,
target: impl Into<InteractionPath>,
capture: impl Into<Option<CaptureInfo>>,
is_click: impl Into<bool>,
) -> Self
pub fn new( timestamp: impl Into<DInstant>, propagation_handle: EventPropagationHandle, window_id: impl Into<WindowId>, device_id: impl Into<Option<DeviceId>>, button: impl Into<MouseButton>, position: impl Into<DipPoint>, modifiers: impl Into<ModifiersState>, state: impl Into<ButtonState>, hits: impl Into<HitTestInfo>, target: impl Into<InteractionPath>, capture: impl Into<Option<CaptureInfo>>, is_click: impl Into<bool>, ) -> 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>>,
button: impl Into<MouseButton>,
position: impl Into<DipPoint>,
modifiers: impl Into<ModifiersState>,
state: impl Into<ButtonState>,
hits: impl Into<HitTestInfo>,
target: impl Into<InteractionPath>,
capture: impl Into<Option<CaptureInfo>>,
is_click: impl Into<bool>,
) -> Self
pub fn now( window_id: impl Into<WindowId>, device_id: impl Into<Option<DeviceId>>, button: impl Into<MouseButton>, position: impl Into<DipPoint>, modifiers: impl Into<ModifiersState>, state: impl Into<ButtonState>, hits: impl Into<HitTestInfo>, target: impl Into<InteractionPath>, capture: impl Into<Option<CaptureInfo>>, is_click: impl Into<bool>, ) -> Self
Arguments for event that happened now (INSTANT.now
).
source§impl MouseInputArgs
impl MouseInputArgs
sourcepub fn capture_allows(&self) -> bool
pub fn capture_allows(&self) -> bool
sourcepub fn is_enabled(&self, widget_id: WidgetId) -> bool
pub fn is_enabled(&self, widget_id: WidgetId) -> bool
If the widget_id
is in the target
is enabled.
sourcepub fn is_disabled(&self, widget_id: WidgetId) -> bool
pub fn is_disabled(&self, widget_id: WidgetId) -> bool
If the widget_id
is in the target
is disabled.
sourcepub fn is_primary(&self) -> bool
pub fn is_primary(&self) -> bool
If the button
is the primary.
sourcepub fn is_context(&self) -> bool
pub fn is_context(&self) -> bool
If the button
is the context (right).
sourcepub fn is_mouse_down(&self) -> bool
pub fn is_mouse_down(&self) -> bool
If the state
is pressed.
sourcepub fn is_mouse_up(&self) -> bool
pub fn is_mouse_up(&self) -> bool
If the state
is released.
sourcepub fn position_wgt(&self) -> Option<PxPoint>
pub fn position_wgt(&self) -> Option<PxPoint>
Gets position in the widget inner bounds.
Trait Implementations§
source§impl AnyEventArgs for MouseInputArgs
impl AnyEventArgs for MouseInputArgs
source§fn delivery_list(&self, list: &mut UpdateDeliveryList)
fn delivery_list(&self, list: &mut UpdateDeliveryList)
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 MouseInputArgs
impl Clone for MouseInputArgs
source§fn clone(&self) -> MouseInputArgs
fn clone(&self) -> MouseInputArgs
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for MouseInputArgs
impl Debug for MouseInputArgs
Auto Trait Implementations§
impl Freeze for MouseInputArgs
impl RefUnwindSafe for MouseInputArgs
impl Send for MouseInputArgs
impl Sync for MouseInputArgs
impl Unpin for MouseInputArgs
impl UnwindSafe for MouseInputArgs
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