Struct input_linux::uinput::UInputHandle
source · 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