Struct DeviceHandle

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

A libinput device.

Implementations§

Source§

impl DeviceHandle

Source

pub fn capabilities(&self) -> Capability

Gets the capabilities of this device.

Source

pub async fn capabilities_async(&self) -> Capability

Async impl for Self::capabilities.

Source

pub fn name(&self) -> String

Gets this device’s name.

Source

pub async fn name_async(&self) -> String

Async impl for Self::name.

Source

pub fn product_id(&self) -> u32

Gets this device’s product id.

Source

pub async fn product_id_async(&self) -> u32

Async impl for Self::product_id.

Source

pub fn vendor_id(&self) -> u32

Gets this device’s vendor id.

Source

pub async fn vendor_id_async(&self) -> u32

Async impl for Self::vendor_id.

Source

pub fn device_type(&self) -> DeviceType

Gets this device’s DeviceType.

Source

pub async fn device_type_async(&self) -> DeviceType

Async impl for Self::device_type.

Source

pub fn map_to_output(&self, output: &OutputHandle)

Maps the absolute input from this device to the corresponding output.

This will cause touch input from this device to map proportionally to the area of an output. For example, tapping in the middle of the device will generate a tap event at the middle of the output.

This only affects devices with touch capability.

If you want to map the device to an arbitrary region, see Self::map_to_region.

Source

pub fn map_to_region(&self, region: Rect)

Maps the absolute input from this device to the corresponding region in the global space.

This will cause touch input from this device to map proportionally to the given region within the global space. For example, tapping in the middle of the device will generate a tap event at the middle of the region. This can be used to map a touch device to more than one output, for example.

This only affects devices with touch capability.

If you want to map the device to a single output, see Self::map_to_output.

Source

pub fn set_accel_profile(&self, accel_profile: AccelProfile)

Sets this device’s acceleration profile.

Source

pub fn set_accel_speed(&self, accel_speed: f64)

Sets this device’s acceleration speed.

Source

pub fn set_calibration_matrix(&self, calibration_matrix: [f32; 6])

Sets this device’s calibration matrix.

Source

pub fn set_click_method(&self, click_method: ClickMethod)

Sets this device’s click method.

Source

pub fn set_disable_while_typing(&self, disable_while_typing: bool)

Sets whether or not this device is disabled while typing.

Source

pub fn set_left_handed(&self, left_handed: bool)

Sets this device to left-handed or not.

Source

pub fn set_middle_emulation(&self, middle_emulation: bool)

Sets whether or not middle emulation is enabled.

Source

pub fn set_rotation_angle(&self, rotation_angle: u32)

Sets this device’s rotation angle.

Source

pub fn set_scroll_button(&self, scroll_button: u32)

Sets this device’s scroll button.

Source

pub fn set_scroll_button_lock(&self, scroll_button_lock: bool)

Sets whether or not the scroll button locks on this device.

Source

pub fn set_scroll_method(&self, scroll_method: ScrollMethod)

Sets this device’s scroll method.

Source

pub fn set_natural_scroll(&self, natural_scroll: bool)

Enables or disables natural scroll on this device.

Source

pub fn set_tap_button_map(&self, tap_button_map: TapButtonMap)

Sets this device’s tap button map.

Source

pub fn set_tap_drag(&self, tap_drag: bool)

Enables or disables tap dragging on this device.

Source

pub fn set_tap_drag_lock(&self, tap_drag_lock: bool)

Sets whether or not tap dragging locks on this device.

Source

pub fn set_tap(&self, tap: bool)

Enables or disables tap-to-click on this device.

Source

pub fn set_send_events_mode(&self, send_events_mode: SendEventsMode)

Sets this device’s send events mode.

Trait Implementations§

Source§

impl Clone for DeviceHandle

Source§

fn clone(&self) -> DeviceHandle

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 Debug for DeviceHandle

Source§

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

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

impl Hash for DeviceHandle

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 DeviceHandle

Source§

fn eq(&self, other: &DeviceHandle) -> 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 DeviceHandle

Source§

impl StructuralPartialEq for DeviceHandle

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
§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

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

§

fn from_ref(input: &T) -> T

Converts to this type from a reference to the input type.
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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.

§

impl<T> IntoRequest<T> for T

§

fn into_request(self) -> Request<T>

Wrap the input message T in a tonic::Request
§

impl<L> LayerExt<L> for L

§

fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>
where L: Layer<S>,

Applies the layer to a service and wraps it in [Layered].
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.
§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more