Struct input::event::tablet_pad::TabletPadModeGroup
[−]
[src]
pub struct TabletPadModeGroup { /* fields omitted */ }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.
Methods
impl TabletPadModeGroup[src]
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.
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.
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.
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.
Devices without mode switching capabilities return true for every button.
fn has_ring(&self, ring: u32) -> bool
Devices without mode switching capabilities return true for every ring.
fn has_strip(&self, strip: u32) -> bool
Devices without mode switching capabilities return true for every strip.
Trait Implementations
impl Eq for TabletPadModeGroup[src]
impl Debug for TabletPadModeGroup[src]
impl FromRaw<libinput_tablet_pad_mode_group> for TabletPadModeGroup[src]
unsafe fn from_raw(ffi: *mut libinput_tablet_pad_mode_group) -> Self
Create a new instance of this type from a raw pointer. Read more
impl AsRaw<libinput_tablet_pad_mode_group> for TabletPadModeGroup[src]
fn as_raw(&self) -> *const libinput_tablet_pad_mode_group
Receive a raw pointer representing this type.
impl Userdata for TabletPadModeGroup[src]
unsafe fn userdata_raw<T: 'static>(&self) -> *mut T
unsafe fn set_userdata_raw<T: 'static>(&self, ptr: *mut T)
unsafe fn userdata<T: 'static>(&self) -> Option<&T>
Receive a reference to the attached userdata, if one exists. Read more
unsafe fn userdata_mut<T: 'static>(&mut self) -> Option<&mut T>
Receive a mutable reference to the attached userdata, if one exists. Read more
unsafe fn set_userdata<T: 'static, U: 'static>(&mut self,
new: Option<T>)
-> Option<U>
new: Option<T>)
-> Option<U>
Set userdata and receive the currently set userdata Read more
impl Clone for TabletPadModeGroup[src]
fn clone(&self) -> Self
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)1.0.0
Performs copy-assignment from source. Read more
impl Drop for TabletPadModeGroup[src]
impl PartialEq for TabletPadModeGroup[src]
fn eq(&self, other: &Self) -> bool
This method tests for self and other values to be equal, and is used by ==. Read more
fn ne(&self, other: &Rhs) -> bool1.0.0
This method tests for !=.
impl Hash for TabletPadModeGroup[src]
fn hash<H: Hasher>(&self, state: &mut H)
Feeds this value into the state given, updating the hasher as necessary.
fn hash_slice<H>(data: &[Self], state: &mut H) where H: Hasher1.3.0
Feeds a slice of this type into the state provided.