pub struct PointerInput<'a> {
pub pass: PointerEventPass,
pub computed_data: ComputedData,
pub cursor_position_rel: Option<PxPosition>,
pub pointer_changes: &'a mut Vec<PointerChange>,
pub key_modifiers: ModifiersState,
/* private fields */
}Expand description
Input for pointer handlers.
This type carries pointer event payload, local geometry, and event consumption helpers. Side effects that are not pointer-specific should use dedicated APIs such as semantics modifiers, hover cursor modifiers, window action helpers, or the IME session bridge instead of a generic request bag.
Fields§
§pass: PointerEventPassCurrent pointer dispatch pass.
computed_data: ComputedDataThe size of the component node, computed during the measure stage.
cursor_position_rel: Option<PxPosition>The position of the cursor, if available. Relative to the root position of the component.
pointer_changes: &'a mut Vec<PointerChange>Pointer changes from the event loop, if any.
key_modifiers: ModifiersStateThe current state of the keyboard modifiers at the time of the event.
Implementations§
Source§impl PointerInput<'_>
impl PointerInput<'_>
Sourcepub fn consume_pointer_changes(&mut self)
pub fn consume_pointer_changes(&mut self)
Marks all current pointer changes as consumed.
Sourcepub fn has_unconsumed_release(&self) -> bool
pub fn has_unconsumed_release(&self) -> bool
Returns whether any current pointer change is an unconsumed release.
Sourcepub fn cursor_position_abs(&self) -> Option<PxPosition>
pub fn cursor_position_abs(&self) -> Option<PxPosition>
Returns the absolute cursor position in window coordinates.
Sourcepub fn block_cursor(&mut self)
pub fn block_cursor(&mut self)
Blocks pointer input to other components.
Sourcepub fn drag_window(&mut self)
pub fn drag_window(&mut self)
Begins a system drag move for the current window.
Sourcepub fn ime_session(&mut self) -> ImeSession<'_>
pub fn ime_session(&mut self) -> ImeSession<'_>
Returns the IME session bridge for the current frame.
Auto Trait Implementations§
impl<'a> Freeze for PointerInput<'a>
impl<'a> RefUnwindSafe for PointerInput<'a>
impl<'a> Send for PointerInput<'a>
impl<'a> Sync for PointerInput<'a>
impl<'a> Unpin for PointerInput<'a>
impl<'a> UnsafeUnpin for PointerInput<'a>
impl<'a> !UnwindSafe for PointerInput<'a>
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
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be
downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further
downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.