Struct evdev_rs::UninitDevice
source · pub struct UninitDevice { /* private fields */ }
Expand description
Opaque struct representing an evdev device with no backing file
Implementations§
source§impl UninitDevice
impl UninitDevice
sourcepub fn new() -> Option<UninitDevice>
pub fn new() -> Option<UninitDevice>
Initialize a new libevdev device.
Generally you should use Device::new_from_file instead of this method
This function only initializes the struct to sane default values.
To actually hook up the device to a kernel device, use set_file
.
sourcepub fn set_file(self, file: File) -> Result<Device>
pub fn set_file(self, file: File) -> Result<Device>
Set the file for this struct and initialize internal data.
If the device changed and you need to re-read a device, use Device::new_from_file
method.
If you need to change the file after
closing and re-opening the same device, use change_file
.
pub fn set_fd(self, file: File) -> Result<Device>
👎Deprecated since 0.5.0: Prefer
set_file
. Some function names were changed so they
more closely match their type signature. See issue 42 for discussion
https://github.com/ndesh26/evdev-rs/issues/42Trait Implementations§
source§impl Debug for UninitDevice
impl Debug for UninitDevice
source§impl DeviceWrapper for UninitDevice
impl DeviceWrapper for UninitDevice
fn raw(&self) -> *mut libevdev
source§fn enable<E: Enable>(&self, e: E) -> Result<()>
fn enable<E: Enable>(&self, e: E) -> Result<()>
Forcibly enable an EventType/InputProp on this device, even if the underlying
device does not support it. While this cannot make the device actually
report such events, it will now return true for has(). Read more
source§fn enable_property(&self, prop: &InputProp) -> Result<()>
fn enable_property(&self, prop: &InputProp) -> Result<()>
Enables this property, a call to
set_file
will overwrite any previously set values Read moresource§fn enable_event_type(&self, ev_type: &EventType) -> Result<()>
fn enable_event_type(&self, ev_type: &EventType) -> Result<()>
Forcibly enable an event type on this device, even if the underlying
device does not support it. While this cannot make the device actually
report such events, it will now return true for libevdev_has_event_type(). Read more
source§fn enable_event_code(
&self,
ev_code: &EventCode,
data: Option<EnableCodeData>
) -> Result<()>
fn enable_event_code( &self, ev_code: &EventCode, data: Option<EnableCodeData> ) -> Result<()>
Forcibly enable an event type on this device, even if the underlying
device does not support it. While this cannot make the device actually
report such events, it will now return true for libevdev_has_event_code(). Read more
source§fn disable<E: Enable>(&self, d: E) -> Result<()>
fn disable<E: Enable>(&self, d: E) -> Result<()>
Forcibly disable an EventType/EventCode on this device, even if the
underlying device provides it. This effectively mutes the respective set of
events. has() will return false for this EventType/EventCode Read more
source§fn disable_event_type(&self, ev_type: &EventType) -> Result<()>
fn disable_event_type(&self, ev_type: &EventType) -> Result<()>
Forcibly disable an event type on this device, even if the underlying
device provides it. This effectively mutes the respective set of
events. libevdev will filter any events matching this type and none will
reach the caller. libevdev_has_event_type() will return false for this
type. Read more
source§fn disable_event_code(&self, code: &EventCode) -> Result<()>
fn disable_event_code(&self, code: &EventCode) -> Result<()>
Forcibly disable an event code on this device, even if the underlying
device provides it. This effectively mutes the respective set of
events. libevdev will filter any events matching this type and code and
none will reach the caller.
has_event_code
will return false for
this code. Read morefn disable_property(&self, prop: &InputProp) -> Result<()>
source§fn has<E: Enable>(&self, e: E) -> bool
fn has<E: Enable>(&self, e: E) -> bool
Returns
true
if device support the InputProp/EventType/EventCode and false otherwisesource§fn has_property(&self, prop: &InputProp) -> bool
fn has_property(&self, prop: &InputProp) -> bool
Returns
true
if device support the property and false otherwise Read moresource§fn has_event_type(&self, ev_type: &EventType) -> bool
fn has_event_type(&self, ev_type: &EventType) -> bool
source§fn has_event_code(&self, code: &EventCode) -> bool
fn has_event_code(&self, code: &EventCode) -> bool
source§fn name(&self) -> Option<&str>
fn name(&self) -> Option<&str>
Get device’s name, as set by the kernel, or overridden by a call to
set_name
source§fn phys(&self) -> Option<&str>
fn phys(&self) -> Option<&str>
Get device’s physical location, as set by the kernel, or overridden by a call to
set_phys
source§fn uniq(&self) -> Option<&str>
fn uniq(&self) -> Option<&str>
Get device’s unique identifier, as set by the kernel, or overridden by a call to
set_uniq
fn set_name(&self, field: &str)
fn set_phys(&self, field: &str)
fn set_uniq(&self, field: &str)
fn product_id(&self) -> u16
fn vendor_id(&self) -> u16
fn bustype(&self) -> u16
fn version(&self) -> u16
fn set_product_id(&self, field: u16)
fn set_vendor_id(&self, field: u16)
fn set_bustype(&self, field: u16)
fn set_version(&self, field: u16)
source§fn abs_info(&self, code: &EventCode) -> Option<AbsInfo>
fn abs_info(&self, code: &EventCode) -> Option<AbsInfo>
Get the axis info for the given axis, as advertised by the kernel. Read more
source§fn set_abs_info(&self, code: &EventCode, absinfo: &AbsInfo)
fn set_abs_info(&self, code: &EventCode, absinfo: &AbsInfo)
Change the abs info for the given EV_ABS event code, if the code exists. Read more
source§fn event_value(&self, code: &EventCode) -> Option<i32>
fn event_value(&self, code: &EventCode) -> Option<i32>
Returns the current value of the event type. Read more
source§fn set_event_value(&self, code: &EventCode, val: i32) -> Result<()>
fn set_event_value(&self, code: &EventCode, val: i32) -> Result<()>
Set the value for a given event type and code. Read more
fn abs_minimum(&self, code: u32) -> Result<i32>
fn abs_maximum(&self, code: u32) -> Result<i32>
fn abs_fuzz(&self, code: u32) -> Result<i32>
fn abs_flat(&self, code: u32) -> Result<i32>
fn abs_resolution(&self, code: u32) -> Result<i32>
fn set_abs_minimum(&self, code: u32, val: i32)
fn set_abs_maximum(&self, code: u32, val: i32)
fn set_abs_fuzz(&self, code: u32, val: i32)
fn set_abs_flat(&self, code: u32, val: i32)
fn set_abs_resolution(&self, code: u32, val: i32)
source§fn slot_value(&self, slot: u32, code: &EventCode) -> Option<i32>
fn slot_value(&self, slot: u32, code: &EventCode) -> Option<i32>
Return the current value of the code for the given slot. Read more
source§fn set_slot_value(&self, slot: u32, code: &EventCode, val: i32) -> Result<()>
fn set_slot_value(&self, slot: u32, code: &EventCode, val: i32) -> Result<()>
Set the value for a given code for the given slot. Read more
source§impl Drop for UninitDevice
impl Drop for UninitDevice
impl Send for UninitDevice
Auto Trait Implementations§
impl Freeze for UninitDevice
impl RefUnwindSafe for UninitDevice
impl !Sync for UninitDevice
impl Unpin for UninitDevice
impl UnwindSafe for UninitDevice
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more