pub struct EvdevHandle<F>(_);
Expand description

A handle to an input device allowing the use of ioctls

Implementations§

source§

impl<F> EvdevHandle<F>

source

pub const fn new(fd: F) -> Self

Create a new handle using an existing open file object.

source

pub fn into_inner(self) -> F

Extracts the contained handle.

source

pub const fn as_inner(&self) -> &F

A reference to the contained handle.

source

pub fn as_inner_mut(&mut self) -> &mut F

A mutable reference to the contained handle.

source§

impl EvdevHandle<File>

source

pub unsafe fn from_fd(fd: RawFd) -> Self

Create a new handle from a raw file descriptor.

source§

impl<F: AsRawFd> EvdevHandle<F>

source

pub fn read(&self, events: &mut [input_event]) -> Result<usize>

Read events from the input device

source

pub fn write(&self, events: &[input_event]) -> Result<usize>

Write events to the input device

source

pub fn driver_version(&self) -> Result<i32>

EVIOCGVERSION

source

pub fn device_id(&self) -> Result<InputId>

EVIOCGID

source

pub fn repeat_settings(&self) -> Result<repeat_settings>

EVIOGREP

source

pub fn set_repeat_settings(&self, value: &repeat_settings) -> Result<()>

EVIOSREP

source

pub fn keycode_legacy(&self) -> Result<[u32; 2]>

EVIOCGKEYCODE

source

pub fn keycode(&self) -> Result<input_keymap_entry>

EVIOCGKEYCODE_V2

source

pub fn set_keycode_legacy(&self, value: &[u32; 2]) -> Result<()>

EVIOCSKEYCODE

source

pub fn set_keycode(&self, value: &input_keymap_entry) -> Result<()>

EVIOCSKEYCODE_V2

source

pub fn device_name_buf(&self, buffer: &mut [u8]) -> Result<usize>

EVIOCGNAME

source

pub fn device_name(&self) -> Result<Vec<u8>>

EVIOCGNAME

source

pub fn physical_location_buf(&self, buffer: &mut [u8]) -> Result<usize>

EVIOCGPHYS

source

pub fn physical_location(&self) -> Result<Vec<u8>>

EVIOCGPHYS

source

pub fn unique_id_buf(&self, buffer: &mut [u8]) -> Result<usize>

EVIOCGUNIQ

source

pub fn unique_id(&self) -> Result<Vec<u8>>

EVIOCGUNIQ

source

pub fn device_properties_raw(&self, buffer: &mut [u8]) -> Result<usize>

EVIOCGPROP

source

pub fn key_state(&self, buffer: &mut [u8]) -> Result<usize>

EVIOCGKEY

source

pub fn led_state(&self, buffer: &mut [u8]) -> Result<usize>

EVIOCGLED

source

pub fn sounds_state(&self, buffer: &mut [u8]) -> Result<usize>

EVIOCGSND

source

pub fn switch_state(&self, buffer: &mut [u8]) -> Result<usize>

EVIOCGSW

source

pub fn send_force_feedback(&self, value: &mut ff_effect) -> Result<()>

EVIOCSFF

source

pub fn erase_force_feedback(&self, value: i16) -> Result<()>

EVIOCRMFF

source

pub fn effects_count(&self) -> Result<i32>

EVIOCGEFFECTS

source

pub fn device_properties(&self) -> Result<Bitmask<InputProperty>>

EVIOCGPROP

source

pub fn multi_touch_slots( &self, code: AbsoluteAxis, values: &mut [i32] ) -> Result<()>

EVIOCGMTSLOTS

Warning: the current implementation can leak uninitialized heap memory into values

source

pub fn event_mask_events(&self) -> Result<Bitmask<EventKind>>

EVIOCGMASK

source

pub fn set_event_mask_events(&self, bitmask: &Bitmask<EventKind>) -> Result<()>

EVIOCSMASK

source

pub fn event_bits(&self) -> Result<Bitmask<EventKind>>

EVIOCGBIT

source

pub fn key_mask(&self) -> Result<Bitmask<Key>>

EVIOCGMASK

source

pub fn set_key_mask(&self, bitmask: &Bitmask<Key>) -> Result<()>

EVIOCSMASK

source

pub fn key_bits(&self) -> Result<Bitmask<Key>>

EVIOCGBIT

source

pub fn relative_mask(&self) -> Result<Bitmask<RelativeAxis>>

EVIOCGMASK

source

pub fn set_relative_mask(&self, bitmask: &Bitmask<RelativeAxis>) -> Result<()>

EVIOCSMASK

source

pub fn relative_bits(&self) -> Result<Bitmask<RelativeAxis>>

EVIOCGBIT

source

pub fn absolute_mask(&self) -> Result<Bitmask<AbsoluteAxis>>

EVIOCGMASK

source

pub fn set_absolute_mask(&self, bitmask: &Bitmask<AbsoluteAxis>) -> Result<()>

EVIOCSMASK

source

pub fn absolute_bits(&self) -> Result<Bitmask<AbsoluteAxis>>

EVIOCGBIT

source

pub fn misc_mask(&self) -> Result<Bitmask<MiscKind>>

EVIOCGMASK

source

pub fn set_misc_mask(&self, bitmask: &Bitmask<MiscKind>) -> Result<()>

EVIOCSMASK

source

pub fn misc_bits(&self) -> Result<Bitmask<MiscKind>>

EVIOCGBIT

source

pub fn switch_mask(&self) -> Result<Bitmask<SwitchKind>>

EVIOCGMASK

source

pub fn set_switch_mask(&self, bitmask: &Bitmask<SwitchKind>) -> Result<()>

EVIOCSMASK

source

pub fn switch_bits(&self) -> Result<Bitmask<SwitchKind>>

EVIOCGBIT

source

pub fn led_mask(&self) -> Result<Bitmask<LedKind>>

EVIOCGMASK

source

pub fn set_led_mask(&self, bitmask: &Bitmask<LedKind>) -> Result<()>

EVIOCSMASK

source

pub fn led_bits(&self) -> Result<Bitmask<LedKind>>

EVIOCGBIT

source

pub fn sound_mask(&self) -> Result<Bitmask<SoundKind>>

EVIOCGMASK

source

pub fn set_sound_mask(&self, bitmask: &Bitmask<SoundKind>) -> Result<()>

EVIOCSMASK

source

pub fn sound_bits(&self) -> Result<Bitmask<SoundKind>>

EVIOCGBIT

source

pub fn autorepeat_mask(&self) -> Result<Bitmask<AutorepeatKind>>

EVIOCGMASK

source

pub fn set_autorepeat_mask( &self, bitmask: &Bitmask<AutorepeatKind> ) -> Result<()>

EVIOCSMASK

source

pub fn autorepeat_bits(&self) -> Result<Bitmask<AutorepeatKind>>

EVIOCGBIT

source

pub fn event_mask_raw(&self, kind: EventKind, buffer: &mut [u8]) -> Result<()>

EVIOCGMASK

source

pub fn set_event_mask_raw(&self, kind: EventKind, buffer: &[u8]) -> Result<()>

EVIOCSMASK

source

pub fn event_bits_raw( &self, kind: EventKind, buffer: &mut [u8] ) -> Result<usize>

EVIOCGBIT

source

pub fn absolute_info(&self, abs: AbsoluteAxis) -> Result<AbsoluteInfo>

EVIOCGABS

source

pub fn set_absolute_info( &self, abs: AbsoluteAxis, info: &AbsoluteInfo ) -> Result<()>

EVIOCSABS

source

pub fn grab(&self, grab: bool) -> Result<()>

EVIOCGRAB

source

pub fn revoke(&self) -> Result<()>

EVIOCREVOKE

source

pub fn set_clock_id(&self, value: i32) -> Result<()>

EVIOCSCLOCKID

Trait Implementations§

source§

impl<F: AsRawFd> AsRawFd for EvdevHandle<F>

source§

fn as_raw_fd(&self) -> RawFd

Extracts the raw file descriptor. Read more
source§

impl<F: FromRawFd> FromRawFd for EvdevHandle<F>

source§

unsafe fn from_raw_fd(fd: RawFd) -> Self

Constructs a new instance of Self from the given raw file descriptor. Read more
source§

impl<F: IntoRawFd> IntoRawFd for EvdevHandle<F>

source§

fn into_raw_fd(self) -> RawFd

Consumes this object, returning the raw underlying file descriptor. Read more

Auto Trait Implementations§

§

impl<F> RefUnwindSafe for EvdevHandle<F>where F: RefUnwindSafe,

§

impl<F> Send for EvdevHandle<F>where F: Send,

§

impl<F> Sync for EvdevHandle<F>where F: Sync,

§

impl<F> Unpin for EvdevHandle<F>where F: Unpin,

§

impl<F> UnwindSafe for EvdevHandle<F>where F: UnwindSafe,

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

const: unstable · source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

const: unstable · source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

const: unstable · source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T> Instrument for T

source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere U: From<T>,

const: unstable · source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
const: unstable · source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
const: unstable · source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<T> WithSubscriber for T

source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more