pub struct InputDevice(pub u64);
Expand description
An input device.
Tuple Fields§
§0: u64
Implementations§
Source§impl InputDevice
impl InputDevice
Sourcepub fn set_keymap(self, keymap: Keymap)
pub fn set_keymap(self, keymap: Keymap)
Sets the keymap of the device.
This overrides the keymap set for the seat. The keymap becomes active when a key on the device is pressed.
Setting the invalid keymap reverts to the seat keymap.
Sourcepub fn has_capability(self, cap: Capability) -> bool
pub fn has_capability(self, cap: Capability) -> bool
Returns whether the device has the specified capability.
Sourcepub fn set_left_handed(self, left_handed: bool)
pub fn set_left_handed(self, left_handed: bool)
Sets the device to be left handed.
This has the effect of swapping the left and right mouse button. See the libinput documentation for more details.
Sourcepub fn set_accel_profile(self, profile: AccelProfile)
pub fn set_accel_profile(self, profile: AccelProfile)
Sets the acceleration profile of the device.
This corresponds to the libinput setting of the same name.
Sourcepub fn set_accel_speed(self, speed: f64)
pub fn set_accel_speed(self, speed: f64)
Sets the acceleration speed of the device.
This corresponds to the libinput setting of the same name.
Sourcepub fn set_transform_matrix(self, matrix: [[f64; 2]; 2])
pub fn set_transform_matrix(self, matrix: [[f64; 2]; 2])
Sets the transformation matrix of the device.
This is not a libinput setting but a setting of the compositor. It currently affects relative mouse motions in that the matrix is applied to the motion. To reduce the mouse speed to 35%, use the following matrix:
[
[0.35, 1.0],
[1.0, 0.35],
]
This might give you better results than using set_accel_profile
and set_accel_speed
.
Sourcepub fn set_calibration_matrix(self, matrix: [[f32; 3]; 2])
pub fn set_calibration_matrix(self, matrix: [[f32; 3]; 2])
Sets the calibration matrix of the device.
This corresponds to the libinput setting of the same name.
Sourcepub fn set_px_per_wheel_scroll(self, px: f64)
pub fn set_px_per_wheel_scroll(self, px: f64)
Sets how many pixel to scroll per scroll wheel dedent.
Default: 15.0
This setting has no effect on non-wheel input such as touchpads.
Some mouse wheels support high-resolution scrolling without discrete steps. In this case a value proportional to this setting will be used.
Sourcepub fn set_tap_enabled(self, enabled: bool)
pub fn set_tap_enabled(self, enabled: bool)
Sets whether tap-to-click is enabled for this device.
See https://wayland.freedesktop.org/libinput/doc/latest/tapping.html
Sourcepub fn set_drag_enabled(self, enabled: bool)
pub fn set_drag_enabled(self, enabled: bool)
Sets whether tap-and-drag is enabled for this device.
See https://wayland.freedesktop.org/libinput/doc/latest/tapping.html
Sourcepub fn set_drag_lock_enabled(self, enabled: bool)
pub fn set_drag_lock_enabled(self, enabled: bool)
Sets whether drag lock is enabled for this device.
See https://wayland.freedesktop.org/libinput/doc/latest/tapping.html
Sourcepub fn set_natural_scrolling_enabled(self, enabled: bool)
pub fn set_natural_scrolling_enabled(self, enabled: bool)
Sets whether natural scrolling is enabled for this device.
See https://wayland.freedesktop.org/libinput/doc/latest/scrolling.html
Sourcepub fn syspath(self) -> String
pub fn syspath(self) -> String
Returns the syspath of this device.
E.g. /sys/devices/pci0000:00/0000:00:08.1/0000:14:00.4/usb5/5-1/5-1.1/5-1.1.3/5-1.1.3:1.0
.
Sourcepub fn on_switch_event<F: FnMut(SwitchEvent) + 'static>(self, f: F)
pub fn on_switch_event<F: FnMut(SwitchEvent) + 'static>(self, f: F)
Sets a callback that will be run if this device triggers a switch event.
Sourcepub fn set_connector(self, connector: Connector)
pub fn set_connector(self, connector: Connector)
Maps this input device to a connector.
The connector should be connected.
This should be used for touch screens and graphics tablets.
Sourcepub fn remove_mapping(self)
pub fn remove_mapping(self)
Removes the mapping of this device to a connector.
Trait Implementations§
Source§impl Clone for InputDevice
impl Clone for InputDevice
Source§fn clone(&self) -> InputDevice
fn clone(&self) -> InputDevice
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more