pub struct DeviceHandle { /* private fields */ }
Expand description
A libinput device.
Implementations§
Source§impl DeviceHandle
impl DeviceHandle
Sourcepub fn capabilities(&self) -> Capability
pub fn capabilities(&self) -> Capability
Gets the capabilities of this device.
Sourcepub async fn capabilities_async(&self) -> Capability
pub async fn capabilities_async(&self) -> Capability
Async impl for Self::capabilities
.
Sourcepub async fn name_async(&self) -> String
pub async fn name_async(&self) -> String
Async impl for Self::name
.
Sourcepub fn product_id(&self) -> u32
pub fn product_id(&self) -> u32
Gets this device’s product id.
Sourcepub async fn product_id_async(&self) -> u32
pub async fn product_id_async(&self) -> u32
Async impl for Self::product_id
.
Sourcepub async fn vendor_id_async(&self) -> u32
pub async fn vendor_id_async(&self) -> u32
Async impl for Self::vendor_id
.
Sourcepub fn device_type(&self) -> DeviceType
pub fn device_type(&self) -> DeviceType
Gets this device’s DeviceType
.
Sourcepub async fn device_type_async(&self) -> DeviceType
pub async fn device_type_async(&self) -> DeviceType
Async impl for Self::device_type
.
Sourcepub fn map_to_output(&self, output: &OutputHandle)
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
.
Sourcepub fn map_to_region(&self, region: Rect)
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
.
Sourcepub fn set_accel_profile(&self, accel_profile: AccelProfile)
pub fn set_accel_profile(&self, accel_profile: AccelProfile)
Sets this device’s acceleration profile.
Sourcepub fn set_accel_speed(&self, accel_speed: f64)
pub fn set_accel_speed(&self, accel_speed: f64)
Sets this device’s acceleration speed.
Sourcepub fn set_calibration_matrix(&self, calibration_matrix: [f32; 6])
pub fn set_calibration_matrix(&self, calibration_matrix: [f32; 6])
Sets this device’s calibration matrix.
Sourcepub fn set_click_method(&self, click_method: ClickMethod)
pub fn set_click_method(&self, click_method: ClickMethod)
Sets this device’s click method.
Sourcepub fn set_disable_while_typing(&self, disable_while_typing: bool)
pub fn set_disable_while_typing(&self, disable_while_typing: bool)
Sets whether or not this device is disabled while typing.
Sourcepub fn set_left_handed(&self, left_handed: bool)
pub fn set_left_handed(&self, left_handed: bool)
Sets this device to left-handed or not.
Sourcepub fn set_middle_emulation(&self, middle_emulation: bool)
pub fn set_middle_emulation(&self, middle_emulation: bool)
Sets whether or not middle emulation is enabled.
Sourcepub fn set_rotation_angle(&self, rotation_angle: u32)
pub fn set_rotation_angle(&self, rotation_angle: u32)
Sets this device’s rotation angle.
Sets this device’s scroll button.
Sets whether or not the scroll button locks on this device.
Sourcepub fn set_scroll_method(&self, scroll_method: ScrollMethod)
pub fn set_scroll_method(&self, scroll_method: ScrollMethod)
Sets this device’s scroll method.
Sourcepub fn set_natural_scroll(&self, natural_scroll: bool)
pub fn set_natural_scroll(&self, natural_scroll: bool)
Enables or disables natural scroll on this device.
Sets this device’s tap button map.
Sourcepub fn set_tap_drag(&self, tap_drag: bool)
pub fn set_tap_drag(&self, tap_drag: bool)
Enables or disables tap dragging on this device.
Sourcepub fn set_tap_drag_lock(&self, tap_drag_lock: bool)
pub fn set_tap_drag_lock(&self, tap_drag_lock: bool)
Sets whether or not tap dragging locks on this device.
Sourcepub fn set_send_events_mode(&self, send_events_mode: SendEventsMode)
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
impl Clone for DeviceHandle
Source§fn clone(&self) -> DeviceHandle
fn clone(&self) -> DeviceHandle
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for DeviceHandle
impl Debug for DeviceHandle
Source§impl Hash for DeviceHandle
impl Hash for DeviceHandle
Source§impl PartialEq for DeviceHandle
impl PartialEq for DeviceHandle
impl Eq for DeviceHandle
impl StructuralPartialEq for DeviceHandle
Auto Trait Implementations§
impl Freeze for DeviceHandle
impl RefUnwindSafe for DeviceHandle
impl Send for DeviceHandle
impl Sync for DeviceHandle
impl Unpin for DeviceHandle
impl UnwindSafe for DeviceHandle
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T
in a tonic::Request
§impl<L> LayerExt<L> for L
impl<L> LayerExt<L> for L
§fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
Layered
].