pub struct UInputHandle<F>(/* private fields */);
Expand description
A handle to a uinput allowing the use of ioctls
Implementations§
Source§impl<F> UInputHandle<F>
impl<F> UInputHandle<F>
Sourcepub fn into_inner(self) -> F
pub fn into_inner(self) -> F
Extracts the contained handle.
Sourcepub fn as_inner_mut(&mut self) -> &mut F
pub fn as_inner_mut(&mut self) -> &mut F
A mutable reference to the contained handle.
Source§impl UInputHandle<OwnedFd>
impl UInputHandle<OwnedFd>
Source§impl<F: AsRawFd> UInputHandle<F>
impl<F: AsRawFd> UInputHandle<F>
Sourcepub fn create_legacy(
&self,
id: &InputId,
name: &[u8],
ff_effects_max: u32,
abs: &[AbsoluteInfoSetup],
) -> Result<()>
pub fn create_legacy( &self, id: &InputId, name: &[u8], ff_effects_max: u32, abs: &[AbsoluteInfoSetup], ) -> Result<()>
Create a new uinput device using the legacy UI_DEV_CREATE
interface
Sourcepub fn create(
&self,
id: &InputId,
name: &[u8],
ff_effects_max: u32,
abs: &[AbsoluteInfoSetup],
) -> Result<()>
pub fn create( &self, id: &InputId, name: &[u8], ff_effects_max: u32, abs: &[AbsoluteInfoSetup], ) -> Result<()>
Create a new uinput device, and fall back on the legacy interface if necessary
Sourcepub fn write(&self, events: &[input_event]) -> Result<usize>
pub fn write(&self, events: &[input_event]) -> Result<usize>
Write input events to the device
Sourcepub fn read(&self, events: &mut [input_event]) -> Result<usize>
pub fn read(&self, events: &mut [input_event]) -> Result<usize>
Read events from uinput (see EV_UINPUT
)
Sourcepub fn sys_path(&self) -> Result<PathBuf>
pub fn sys_path(&self) -> Result<PathBuf>
Returns the sysfs directory for the input device.
Note that this path may not exist if sysfs is not mounted in the standard /sys
location.
Sourcepub fn evdev_name(&self) -> Result<OsString>
pub fn evdev_name(&self) -> Result<OsString>
The device name of the input device.
Sourcepub fn evdev_path(&self) -> Result<PathBuf>
pub fn evdev_path(&self) -> Result<PathBuf>
The device node path of the input device.
Note that this path may not exist if /dev/input/*
isn’t mounted properly.
Sourcepub fn dev_create(&self) -> Result<()>
pub fn dev_create(&self) -> Result<()>
UI_DEV_CREATE
Sourcepub fn dev_destroy(&self) -> Result<()>
pub fn dev_destroy(&self) -> Result<()>
UI_DEV_DESTROY
Sourcepub fn dev_setup(&self, value: &uinput_setup) -> Result<()>
pub fn dev_setup(&self, value: &uinput_setup) -> Result<()>
UI_DEV_SETUP
Sourcepub fn abs_setup(&self, value: &uinput_abs_setup) -> Result<()>
pub fn abs_setup(&self, value: &uinput_abs_setup) -> Result<()>
UI_ABS_SETUP
Sourcepub fn set_keybit(&self, value: Key) -> Result<()>
pub fn set_keybit(&self, value: Key) -> Result<()>
UI_SET_KEYBIT
Sourcepub fn set_relbit(&self, value: RelativeAxis) -> Result<()>
pub fn set_relbit(&self, value: RelativeAxis) -> Result<()>
UI_SET_RELBIT
Sourcepub fn set_absbit(&self, value: AbsoluteAxis) -> Result<()>
pub fn set_absbit(&self, value: AbsoluteAxis) -> Result<()>
UI_SET_ABSBIT
Sourcepub fn set_mscbit(&self, value: MiscKind) -> Result<()>
pub fn set_mscbit(&self, value: MiscKind) -> Result<()>
UI_SET_MSCBIT
Sourcepub fn set_ledbit(&self, value: LedKind) -> Result<()>
pub fn set_ledbit(&self, value: LedKind) -> Result<()>
UI_SET_LEDBIT
Sourcepub fn set_sndbit(&self, value: SoundKind) -> Result<()>
pub fn set_sndbit(&self, value: SoundKind) -> Result<()>
UI_SET_SNDBIT
Sourcepub fn set_ffbit(&self, value: ForceFeedbackKind) -> Result<()>
pub fn set_ffbit(&self, value: ForceFeedbackKind) -> Result<()>
UI_SET_FFBIT
Sourcepub fn set_swbit(&self, value: SwitchKind) -> Result<()>
pub fn set_swbit(&self, value: SwitchKind) -> Result<()>
UI_SET_SWBIT
Sourcepub fn set_propbit(&self, value: InputProperty) -> Result<()>
pub fn set_propbit(&self, value: InputProperty) -> Result<()>
UI_SET_PROPBIT
Sourcepub fn ff_upload_begin(&self, value: &mut uinput_ff_upload) -> Result<()>
pub fn ff_upload_begin(&self, value: &mut uinput_ff_upload) -> Result<()>
UI_BEGIN_FF_UPLOAD
Sourcepub fn ff_upload_end(&self, value: &uinput_ff_upload) -> Result<()>
pub fn ff_upload_end(&self, value: &uinput_ff_upload) -> Result<()>
UI_END_FF_UPLOAD
Sourcepub fn ff_erase_begin(&self, value: &mut uinput_ff_erase) -> Result<()>
pub fn ff_erase_begin(&self, value: &mut uinput_ff_erase) -> Result<()>
UI_BEGIN_FF_ERASE
Sourcepub fn ff_erase_end(&self, value: &uinput_ff_erase) -> Result<()>
pub fn ff_erase_end(&self, value: &uinput_ff_erase) -> Result<()>
UI_END_FF_ERASE
Sourcepub fn sys_name_buf(&self, buffer: &mut [u8]) -> Result<usize>
pub fn sys_name_buf(&self, buffer: &mut [u8]) -> Result<usize>
UI_GET_SYSNAME
Trait Implementations§
Source§impl<F: AsRawFd> AsFd for UInputHandle<F>
impl<F: AsRawFd> AsFd for UInputHandle<F>
Source§fn as_fd<'a>(&'a self) -> BorrowedFd<'a>
fn as_fd<'a>(&'a self) -> BorrowedFd<'a>
Source§impl<F: FromRawFd> FromRawFd for UInputHandle<F>
impl<F: FromRawFd> FromRawFd for UInputHandle<F>
Source§unsafe fn from_raw_fd(fd: RawFd) -> Self
unsafe fn from_raw_fd(fd: RawFd) -> Self
Self
from the given raw file
descriptor. Read more