pub struct EvdevDevice {
pub device_id: Option<u32>,
pub device_num: Option<u32>,
pub name: Option<String>,
pub phys: Option<String>,
pub uniq: Option<String>,
pub id: Option<Identifier>,
pub absolute_axis_infos: HashMap<u32, AbsInfo>,
pub ev_bitmask: Option<Vec<u8>>,
pub event_type_bitmasks: HashMap<u32, Vec<u8>>,
pub prop_bitmask: Option<Vec<u8>>,
pub axis_states: HashMap<u32, AxisMap>,
pub abs_mt_states: HashMap<u32, SlotValuesMap>,
}Expand description
The properties of an input device that don’t change during the time that it’s connected, as well as the current values for all of its axes.
Next ID: 13
Fields§
§device_id: Option<u32>The device’s unique ID number. This need not be the number of its /dev/input/event node.
device_num: Option<u32>The number of the evdev device (i.e. from its /dev/input/eventX node path).
name: Option<String>The device’s name.
phys: Option<String>The physical path to the device in the system hierarchy.
uniq: Option<String>The unique identification code for the device (if it has one).
id: Option<Identifier>The device’s ID numbers.
absolute_axis_infos: HashMap<u32, AbsInfo>A map of information for each of the device’s absolute axes. Keys are the Linux ABS_* constants.
ev_bitmask: Option<Vec<u8>>Bitmask specifying which types of events the device declares.
event_type_bitmasks: HashMap<u32, Vec<u8>>A map of bitmasks specifying which axes of each type the device declares. Keys are the Linux EV_* constants.
prop_bitmask: Option<Vec<u8>>Bitmask of properties declared by the device.
axis_states: HashMap<u32, AxisMap>Current states of device axes.
The keys are the Linux event type constants (e.g. EV_KEY, EV_ABS, etc.). We don’t need to keep track of states for all axis types, only KEY, SW, LED, and ABS, so only those will have entries in this map. States for ABS_MT_* axes (which have multiple slots) will be kept in abs_mt_states instead.
abs_mt_states: HashMap<u32, SlotValuesMap>Current states of ABS_MT_* axes other than ABS_MT_SLOT. The keys are the ABS axis codes.
Implementations§
Source§impl EvdevDevice
impl EvdevDevice
Sourcepub fn device_id(&self) -> u32
pub fn device_id(&self) -> u32
Returns the value of device_id, or the default value if device_id is unset.
Sourcepub fn device_num(&self) -> u32
pub fn device_num(&self) -> u32
Returns the value of device_num, or the default value if device_num is unset.
Sourcepub fn ev_bitmask(&self) -> &[u8] ⓘ
pub fn ev_bitmask(&self) -> &[u8] ⓘ
Returns the value of ev_bitmask, or the default value if ev_bitmask is unset.
Sourcepub fn prop_bitmask(&self) -> &[u8] ⓘ
pub fn prop_bitmask(&self) -> &[u8] ⓘ
Returns the value of prop_bitmask, or the default value if prop_bitmask is unset.
Trait Implementations§
Source§impl Clone for EvdevDevice
impl Clone for EvdevDevice
Source§fn clone(&self) -> EvdevDevice
fn clone(&self) -> EvdevDevice
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for EvdevDevice
impl Debug for EvdevDevice
Source§impl Default for EvdevDevice
impl Default for EvdevDevice
Source§impl Message for EvdevDevice
impl Message for EvdevDevice
Source§fn encoded_len(&self) -> usize
fn encoded_len(&self) -> usize
Source§fn encode<B>(&self, buf: &mut B) -> Result<(), EncodeError>where
B: BufMut,
Self: Sized,
fn encode<B>(&self, buf: &mut B) -> Result<(), EncodeError>where
B: BufMut,
Self: Sized,
Source§fn encode_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
fn encode_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
Source§fn encode_length_delimited<B>(&self, buf: &mut B) -> Result<(), EncodeError>where
B: BufMut,
Self: Sized,
fn encode_length_delimited<B>(&self, buf: &mut B) -> Result<(), EncodeError>where
B: BufMut,
Self: Sized,
Source§fn encode_length_delimited_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
fn encode_length_delimited_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
Source§fn decode<B>(buf: B) -> Result<Self, DecodeError>where
B: Buf,
Self: Default,
fn decode<B>(buf: B) -> Result<Self, DecodeError>where
B: Buf,
Self: Default,
Source§fn decode_length_delimited<B>(buf: B) -> Result<Self, DecodeError>where
B: Buf,
Self: Default,
fn decode_length_delimited<B>(buf: B) -> Result<Self, DecodeError>where
B: Buf,
Self: Default,
Source§fn merge<B>(&mut self, buf: B) -> Result<(), DecodeError>where
B: Buf,
Self: Sized,
fn merge<B>(&mut self, buf: B) -> Result<(), DecodeError>where
B: Buf,
Self: Sized,
self. Read moreSource§fn merge_length_delimited<B>(&mut self, buf: B) -> Result<(), DecodeError>where
B: Buf,
Self: Sized,
fn merge_length_delimited<B>(&mut self, buf: B) -> Result<(), DecodeError>where
B: Buf,
Self: Sized,
self.