pub struct PointerEvent { /* private fields */ }Expand description
One pointer event handed to a handler, with its consumption state shared with the
Host boundary like KeyEvent’s.
Calling PointerEvent::consume keeps the event from reaching an ancestor’s handler
and from doing what the Renderer would otherwise do with it: a consumed Wheel does not
scroll, a consumed ContextMenu shows no menu.
Implementations§
Source§impl PointerEvent
impl PointerEvent
pub fn new( kind: PointerKind, pointer_id: u32, pointer_type: PointerType, x: f32, y: f32, buttons: u32, button: u32, modifiers: u32, click_count: u32, delta_x: f32, delta_y: f32, delta_mode: WheelDeltaMode, timestamp_nanos: u64, ) -> Self
pub fn kind(&self) -> PointerKind
Sourcepub fn pointer_id(&self) -> u32
pub fn pointer_id(&self) -> u32
Names one finger, pen or mouse across its events. A mouse is 1.
pub fn pointer_type(&self) -> PointerType
Sourcepub fn x(&self) -> f32
pub fn x(&self) -> f32
Distance from the node’s left edge, in dp. Outside the node while it holds a capture.
The buttons held now, as a mask of pointer_button bits.
The button that caused this Down or Up, and 0 for any other kind.
pub fn shift_key(&self) -> bool
pub fn ctrl_key(&self) -> bool
pub fn alt_key(&self) -> bool
pub fn meta_key(&self) -> bool
Sourcepub fn click_count(&self) -> u32
pub fn click_count(&self) -> u32
Consecutive presses in the same place on a Down or Up: 1, 2, and so on.
pub fn delta_mode(&self) -> WheelDeltaMode
Sourcepub fn timestamp_nanos(&self) -> u64
pub fn timestamp_nanos(&self) -> u64
When the OS produced the input, on the monotonic clock render_frame also uses.
pub fn consume(&self)
pub fn consumed(&self) -> bool
Trait Implementations§
Source§impl Clone for PointerEvent
impl Clone for PointerEvent
Auto Trait Implementations§
impl !RefUnwindSafe for PointerEvent
impl !Send for PointerEvent
impl !Sync for PointerEvent
impl !UnwindSafe for PointerEvent
impl Freeze for PointerEvent
impl Unpin for PointerEvent
impl UnsafeUnpin for PointerEvent
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
Mutably borrows from an owned value. Read more