pub struct MouseInputArgs {
pub timestamp: DInstant,
pub window_id: WindowId,
pub device_id: Option<InputDeviceId>,
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,
pub propagation: EventPropagationHandle,
}Expand description
MOUSE_INPUT_EVENT arguments.
Fields§
§timestamp: DInstantInstant the event happened.
window_id: WindowIdId of window that received the event.
device_id: Option<InputDeviceId>Id of device that generated the event.
Which mouse button generated the event.
position: DipPointPosition of the mouse in the window’s content area.
modifiers: ModifiersStateWhat modifier keys where pressed when this event happened.
state: ButtonStateThe state the button was changed to.
hits: HitTestInfoHit-test result for the mouse point in the window.
target: InteractionPathFull path to the top-most hit in hits.
capture: Option<CaptureInfo>Current pointer capture.
is_click: boolIf MOUSE_CLICK_EVENT will notify because of this input.
The click event shares the same propagation handle as this event.
propagation: EventPropagationHandlePropagation handle associated with this event instance.
Cloned arguments share the same handle, some arguments may also share the handle of another event if they share the same cause.
Implementations§
Source§impl MouseInputArgs
impl MouseInputArgs
Sourcepub fn new(
timestamp: impl Into<DInstant>,
propagation: EventPropagationHandle,
window_id: impl Into<WindowId>,
device_id: impl Into<Option<InputDeviceId>>,
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: EventPropagationHandle, window_id: impl Into<WindowId>, device_id: impl Into<Option<InputDeviceId>>, 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<InputDeviceId>>,
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<InputDeviceId>>, 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, wgt: (WindowId, WidgetId)) -> bool
pub fn capture_allows(&self, wgt: (WindowId, WidgetId)) -> bool
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.
Trait Implementations§
Source§impl AnyEventArgs for MouseInputArgs
impl AnyEventArgs for MouseInputArgs
Source§fn propagation(&self) -> &EventPropagationHandle
fn propagation(&self) -> &EventPropagationHandle
Source§fn clone_boxed(&self) -> Box<dyn AnyEventArgs>
fn clone_boxed(&self) -> Box<dyn AnyEventArgs>
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
Source§impl PartialEq for MouseInputArgs
impl PartialEq for MouseInputArgs
impl EventArgs for MouseInputArgs
impl StructuralPartialEq 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> AnyVarValue for T
impl<T> AnyVarValue for T
Source§fn clone_boxed(&self) -> BoxAnyVarValue
fn clone_boxed(&self) -> BoxAnyVarValue
Source§fn eq_any(&self, other: &(dyn AnyVarValue + 'static)) -> bool
fn eq_any(&self, other: &(dyn AnyVarValue + 'static)) -> bool
self and other are equal.Source§fn try_swap(&mut self, other: &mut (dyn AnyVarValue + 'static)) -> bool
fn try_swap(&mut self, other: &mut (dyn AnyVarValue + 'static)) -> bool
other if both are of the same type.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,
§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