Struct TabletTool

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

An object representing a tool being used by a device with the DeviceCapability::TabletTool capability.

Tablet events generated by such a device are bound to a specific tool rather than coming from the device directly. Depending on the hardware it is possible to track the same physical tool across multiple Devices, see Tracking unique tools.

Implementations§

Source§

impl TabletTool

Source

pub fn serial(&self) -> u64

Return the serial number of a tool.

If the tool does not report a serial number, this function returns zero. See Tracking unique tools for details.

Source

pub fn tool_id(&self) -> u64

Return the tool ID for a tool object.

If nonzero, this number identifies the specific type of the tool with more precision than the type returned in tool_type, see Vendor-specific tablet tool types. Not all tablets support a tool ID.

Tablets known to support tool IDs include the Wacom Intuos 3, 4, 5, Wacom Cintiq and Wacom Intuos Pro series.

Source

pub fn tool_type(&self) -> Option<TabletToolType>

Return the tool type for a tool object, see Vendor-specific tablet tool types for details.

A return value of None means the tool type is not known.

Source

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

Check if a tablet tool has a button with the passed-in code (see linux/input.h).

Source

pub fn has_distance(&self) -> bool

Return whether the tablet tool supports distance.

Source

pub fn has_pressure(&self) -> bool

Return whether the tablet tool supports pressure.

Source

pub fn has_rotation(&self) -> bool

Return whether the tablet tool supports z-rotation.v

Source

pub fn has_slider(&self) -> bool

Return whether the tablet tool has a slider axis.

Source

pub fn has_tilt(&self) -> bool

Return whether the tablet tool supports tilt.

Source

pub fn has_wheel(&self) -> bool

Return whether the tablet tool has a relative wheel.

Source

pub fn is_unique(&self) -> bool

Returns true if the physical tool can be uniquely identified by libinput, or false otherwise.

If a tool can be uniquely identified, keeping a reference to the tool allows tracking the tool across proximity out sequences and across compatible tablets. See Tracking unique tools for more details.

Source

pub fn tablet_tool_has_size(&self) -> bool

Returns whether the tablet tool has a ellipsis major and minor.

Where the underlying hardware only supports one of either major or minor, libinput emulated the other axis as a cicular contact, i.e. major == minor for all values of major.

Trait Implementations§

Source§

impl AsRaw<libinput_tablet_tool> for TabletTool

Source§

fn as_raw(&self) -> *const libinput_tablet_tool

Receive a raw pointer representing this type.
Source§

impl Clone for TabletTool

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 TabletTool

Source§

fn context(&self) -> &Libinput

Returns the underlying libinput context
Source§

impl Debug for TabletTool

Source§

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

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

impl Drop for TabletTool

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more
Source§

impl FromRaw<libinput_tablet_tool> for TabletTool

Source§

unsafe fn from_raw(ffi: *mut libinput_tablet_tool, 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 TabletTool

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 TabletTool

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 TabletTool

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.