Struct TabletPadModeGroup

Source
pub struct TabletPadModeGroup { /* private fields */ }
Expand description

A mode on a tablet pad is a virtual grouping of functionality, usually based on some visual feedback like LEDs on the pad.

The set of buttons, rings and strips that share the same mode are a “mode group”. Whenever the mode changes, all buttons, rings and strips within this mode group are affected. See Tablet pad modes for detail.

Most tablets only have a single mode group, some tablets provide multiple mode groups through independent banks of LEDs (e.g. the Wacom Cintiq 24HD). libinput guarantees that at least one mode group is always available.

Implementations§

Source§

impl TabletPadModeGroup

Source

pub fn button_is_toggle(&self, button: u32) -> bool

The toggle button in a mode group is the button assigned to cycle to or directly assign a new mode when pressed.

Not all devices have a toggle button and some devices may have more than one toggle button. For example, the Wacom Cintiq 24HD has six toggle buttons in two groups, each directly selecting one of the three modes per group.

Devices without mode switching capabilities return false for every button.

Source

pub fn index(&self) -> u32

The returned number is the same index as passed to Device::tablet_pad_mode_group.

For tablets with only one mode this number is always 0.

Source

pub fn mode(&self) -> u32

Return the current mode this mode group is in.

Note that the returned mode is the mode valid as of completing the last Libinput::dispatch. The returned mode may thus be different than the mode returned by TabletPadEvent::mode.

For example, if the mode was toggled three times between the call to Libinput::dispatch, this function returns the third mode but the events in the event queue will return the modes 1, 2 and 3, respectively.

Source

pub fn number_of_modes(&self) -> u32

Query the mode group for the number of available modes.

The number of modes is usually decided by the number of physical LEDs available on the device. Different mode groups may have a different number of modes. Use TabletPadModeGroup::mode to get the currently active mode.

libinput guarantees that at least one mode is available. A device without mode switching capability has a single mode group and a single mode.

Source

pub fn has_button(&self, button: u32) -> bool

Devices without mode switching capabilities return true for every button.

Source

pub fn has_ring(&self, ring: u32) -> bool

Devices without mode switching capabilities return true for every ring.

Source

pub fn has_strip(&self, strip: u32) -> bool

Devices without mode switching capabilities return true for every strip.

Trait Implementations§

Source§

impl AsRaw<libinput_tablet_pad_mode_group> for TabletPadModeGroup

Source§

fn as_raw(&self) -> *const libinput_tablet_pad_mode_group

Receive a raw pointer representing this type.
Source§

impl Clone for TabletPadModeGroup

Source§

fn clone(&self) -> Self

Returns a copy 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 Context for TabletPadModeGroup

Source§

fn context(&self) -> &Libinput

Returns the underlying libinput context
Source§

impl Debug for TabletPadModeGroup

Source§

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

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

impl Drop for TabletPadModeGroup

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more
Source§

impl FromRaw<libinput_tablet_pad_mode_group> for TabletPadModeGroup

Source§

unsafe fn from_raw( ffi: *mut libinput_tablet_pad_mode_group, context: &Libinput, ) -> Self

Create a new instance of this type from a raw pointer and it’s context. If the type of the struct is a valid libinput type, but is unknown to this library, it panics instead. Read more
Source§

impl Hash for TabletPadModeGroup

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 TabletPadModeGroup

Source§

fn eq(&self, other: &Self) -> 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 Eq for TabletPadModeGroup

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.