Enum PointerButton

Source
#[repr(u32)]
pub enum PointerButton {
Show 32 variants Primary = 1, Secondary = 2, Auxiliary = 4, X1 = 8, X2 = 16, PenEraser = 32, B7 = 64, B8 = 128, B9 = 256, B10 = 512, B11 = 1_024, B12 = 2_048, B13 = 4_096, B14 = 8_192, B15 = 16_384, B16 = 32_768, B17 = 65_536, B18 = 131_072, B19 = 262_144, B20 = 524_288, B21 = 1_048_576, B22 = 2_097_152, B23 = 4_194_304, B24 = 8_388_608, B25 = 16_777_216, B26 = 33_554_432, B27 = 67_108_864, B28 = 134_217_728, B29 = 268_435_456, B30 = 536_870_912, B31 = 1_073_741_824, B32 = 2_147_483_648,
}
Expand description

Describes a button of a pointer input device, such as a mouse or stylus pen.

B7..B32 exist for the purpose of supporting pointer devices with large numbers of buttons. These exotic pointer buttons top out around the 24 buttons range in practice, and Windows doesn’t support more than 32 mouse buttons in most APIs, therefore 32 was chosen as the upper limit.

Variants§

§

Primary = 1

Primary button, commonly the left mouse button, touch contact, pen contact.

§

Secondary = 2

Secondary button, commonly the right mouse button, pen barrel button.

§

Auxiliary = 4

Auxiliary button, commonly the middle mouse button.

§

X1 = 8

X1 (back) Mouse.

§

X2 = 16

X2 (forward) Mouse.

§

PenEraser = 32

Pen erase button.

§

B7 = 64

Button 7.

§

B8 = 128

Button 8.

§

B9 = 256

Button 9.

§

B10 = 512

Button 10.

§

B11 = 1_024

Button 11.

§

B12 = 2_048

Button 12.

§

B13 = 4_096

Button 13.

§

B14 = 8_192

Button 14.

§

B15 = 16_384

Button 15.

§

B16 = 32_768

Button 16.

§

B17 = 65_536

Button 17.

§

B18 = 131_072

Button 18.

§

B19 = 262_144

Button 19.

§

B20 = 524_288

Button 20.

§

B21 = 1_048_576

Button 21.

§

B22 = 2_097_152

Button 22.

§

B23 = 4_194_304

Button 23.

§

B24 = 8_388_608

Button 24.

§

B25 = 16_777_216

Button 25.

§

B26 = 33_554_432

Button 26.

§

B27 = 67_108_864

Button 27.

§

B28 = 134_217_728

Button 28.

§

B29 = 268_435_456

Button 29.

§

B30 = 536_870_912

Button 30.

§

B31 = 1_073_741_824

Button 31.

§

B32 = 2_147_483_648

Button 32.

Trait Implementations§

Source§

impl BitOr<PointerButton> for PointerButtons

Source§

type Output = PointerButtons

The resulting type after applying the | operator.
Source§

fn bitor(self, rhs: PointerButton) -> Self

Performs the | operation. Read more
Source§

impl BitOr for PointerButton

Source§

type Output = PointerButtons

The resulting type after applying the | operator.
Source§

fn bitor(self, rhs: Self) -> Self::Output

Performs the | operation. Read more
Source§

impl BitOrAssign<PointerButton> for PointerButtons

Source§

fn bitor_assign(&mut self, rhs: PointerButton)

Performs the |= operation. Read more
Source§

impl Clone for PointerButton

Source§

fn clone(&self) -> PointerButton

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for PointerButton

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl From<PointerButton> for PointerButtons

Source§

fn from(button: PointerButton) -> Self

Converts to this type from the input type.
Source§

impl Hash for PointerButton

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl PartialEq for PointerButton

Source§

fn eq(&self, other: &PointerButton) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Copy for PointerButton

Source§

impl Eq for PointerButton

Source§

impl StructuralPartialEq for PointerButton

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.