pub enum PointerButton {
Primary,
Secondary,
Middle,
}Expand description
Which mouse button (or pointer button) generated a pointer event.
The host backend translates its native button id to one of these
before calling pointer_down / pointer_up.
Variants§
Primary
Left mouse, primary touch, or pen tip. Drives Click.
Secondary
Right mouse or two-finger touch. Drives SecondaryClick —
typically opens a context menu.
Middle
Middle mouse / scroll-wheel click. No library default; surfaced
as MiddleClick for apps that want it (autoscroll, paste-on-X).
Implementations§
Source§impl PointerButton
impl PointerButton
Translate a Linux evdev button code (the button field of
wl_pointer.button, <linux/input-event-codes.h>’s BTN_*)
to a damascene button: BTN_LEFT (0x110) → Primary,
BTN_RIGHT (0x111) → Secondary, BTN_MIDDLE (0x112) →
Middle. Side/extra/task buttons return None — not surfaced
today.
For raw Wayland hosts (layer-shell bars, notification daemons) that read pointer buttons off the wire without winit in the loop.
Trait Implementations§
Source§impl Clone for PointerButton
impl Clone for PointerButton
Source§fn clone(&self) -> PointerButton
fn clone(&self) -> PointerButton
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for PointerButton
Source§impl Debug for PointerButton
impl Debug for PointerButton
impl Eq for PointerButton
Source§impl PartialEq for PointerButton
impl PartialEq for PointerButton
Source§fn eq(&self, other: &PointerButton) -> bool
fn eq(&self, other: &PointerButton) -> bool
self and other values to be equal, and is used by ==.impl StructuralPartialEq for PointerButton
Auto Trait Implementations§
impl Freeze for PointerButton
impl RefUnwindSafe for PointerButton
impl Send for PointerButton
impl Sync for PointerButton
impl Unpin for PointerButton
impl UnsafeUnpin for PointerButton
impl UnwindSafe for PointerButton
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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
impl<T> Scalar for T
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.