Set the absolute axes of this device.
(self, axis: &UinputAbsSetup)
| 95 | |
| 96 | /// Set the absolute axes of this device. |
| 97 | pub fn with_absolute_axis(self, axis: &UinputAbsSetup) -> io::Result<Self> { |
| 98 | unsafe { |
| 99 | sys::ui_set_evbit( |
| 100 | self.fd.as_raw_fd(), |
| 101 | crate::EventType::ABSOLUTE.0 as nix::sys::ioctl::ioctl_param_type, |
| 102 | )?; |
| 103 | sys::ui_set_absbit( |
| 104 | self.fd.as_raw_fd(), |
| 105 | axis.code() as nix::sys::ioctl::ioctl_param_type, |
| 106 | )?; |
| 107 | sys::ui_abs_setup(self.fd.as_raw_fd(), &axis.0 as *const uinput_abs_setup)?; |
| 108 | } |
| 109 | |
| 110 | Ok(self) |
| 111 | } |
| 112 | |
| 113 | /// Set the relative axes of this device. |
| 114 | pub fn with_relative_axes(self, axes: &AttributeSetRef<RelativeAxisCode>) -> io::Result<Self> { |