Query devices using new evdev crate
This commit is contained in:
parent
2b571347ec
commit
0ada3bfa28
3 changed files with 794 additions and 127 deletions
250
src/device.rs
250
src/device.rs
|
@ -1,120 +1,132 @@
|
|||
use evdev_rs::{Device as EvDevice, EventType, InputEventKind};
|
||||
use std::collections::HashMap;
|
||||
use anyhow::Result;
|
||||
use evdev_rs::{
|
||||
enums::{EventCode, EventType},
|
||||
Device as EvDevice, DeviceWrapper,
|
||||
};
|
||||
use std::{collections::HashMap, fs::File, os::unix::prelude::OsStrExt};
|
||||
|
||||
use crate::event_code_iters::*;
|
||||
use crate::graph_types::{Descriptor, NodeDescriptor};
|
||||
|
||||
pub struct Device {
|
||||
device: EvDevice,
|
||||
path: String,
|
||||
|
||||
supported_events: HashMap<EventType, Vec<InputEventKind>>,
|
||||
supported_events: HashMap<EventType, Vec<EventCode>>,
|
||||
}
|
||||
|
||||
impl Device {
|
||||
fn enumerate() -> Vec<String> {
|
||||
fn enumerate() -> Result<Vec<String>> {
|
||||
let mut files = Vec::new();
|
||||
|
||||
if let Some(readdir) = std::fs::read_dir("/dev/input").ok() {
|
||||
for entry in readdir {
|
||||
let path = entry.unwrap().path();
|
||||
let path = entry?.path();
|
||||
let fname = path.file_name().unwrap();
|
||||
if fname.as_bytes().starts_with(b"event") {
|
||||
// Try to load read/write, then fall back to read-only.
|
||||
if options
|
||||
if File::options()
|
||||
.read(true)
|
||||
.write(true)
|
||||
.open(path)
|
||||
.or_else(|_| options.write(false).open(path))
|
||||
.open(&path)
|
||||
.or_else(|_| File::options().read(true).write(false).open(&path))
|
||||
.is_ok()
|
||||
{
|
||||
files.push(fname);
|
||||
files.push(path.as_path().to_str().unwrap().to_string());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
files
|
||||
Ok(files)
|
||||
}
|
||||
|
||||
pub fn query() -> Vec<Device> {
|
||||
evdev::enumerate()
|
||||
.map(|(path, device)| {
|
||||
let supported_events = device
|
||||
.supported_events()
|
||||
.iter()
|
||||
.map(|event| {
|
||||
let input_kind: Vec<InputEventKind> = match event {
|
||||
evdev::EventType::KEY => device
|
||||
.supported_keys()
|
||||
.map(|keys| {
|
||||
keys.iter().map(|key| InputEventKind::Key(key)).collect()
|
||||
})
|
||||
.unwrap_or(Vec::new()),
|
||||
evdev::EventType::RELATIVE => device
|
||||
.supported_relative_axes()
|
||||
.map(|axes| {
|
||||
axes.iter()
|
||||
.map(|rel_axis| InputEventKind::RelAxis(rel_axis))
|
||||
.collect()
|
||||
})
|
||||
.unwrap_or(Vec::new()),
|
||||
evdev::EventType::ABSOLUTE => device
|
||||
.supported_absolute_axes()
|
||||
.map(|axes| {
|
||||
axes.iter()
|
||||
.map(|abs_axis| InputEventKind::AbsAxis(abs_axis))
|
||||
.collect()
|
||||
})
|
||||
.unwrap_or(Vec::new()),
|
||||
evdev::EventType::SWITCH => device
|
||||
.supported_switches()
|
||||
.map(|switches| {
|
||||
switches
|
||||
.iter()
|
||||
.map(|switch| InputEventKind::Switch(switch))
|
||||
.collect()
|
||||
})
|
||||
.unwrap_or(Vec::new()),
|
||||
evdev::EventType::MISC => device
|
||||
.misc_properties()
|
||||
.map(|miscs| {
|
||||
miscs
|
||||
.iter()
|
||||
.map(|misc| InputEventKind::Misc(misc))
|
||||
.collect()
|
||||
})
|
||||
.unwrap_or(Vec::new()),
|
||||
evdev::EventType::SOUND => device
|
||||
.supported_sounds()
|
||||
.map(|sounds| {
|
||||
sounds
|
||||
.iter()
|
||||
.map(|sound| InputEventKind::Sound(sound))
|
||||
.collect()
|
||||
})
|
||||
.unwrap_or(Vec::new()),
|
||||
evdev::EventType::FORCEFEEDBACK => device
|
||||
.supported_forcefeedback_effects()
|
||||
.map(|ffs| {
|
||||
ffs.iter()
|
||||
.map(|ff| InputEventKind::ForceFeedback(ff))
|
||||
.collect()
|
||||
})
|
||||
.unwrap_or(Vec::new()),
|
||||
pub fn query() -> Result<Vec<Device>> {
|
||||
Self::enumerate()?
|
||||
.into_iter()
|
||||
.map(|path| {
|
||||
let file = File::open(&path)?;
|
||||
let device = EvDevice::new_from_file(file)?;
|
||||
let mut supported_events = HashMap::new();
|
||||
|
||||
_ => Vec::new(),
|
||||
};
|
||||
if device.has(&EventType::EV_KEY) {
|
||||
let mut keys = Vec::new();
|
||||
|
||||
(event, input_kind)
|
||||
})
|
||||
.collect();
|
||||
for key in ev_keys().iter() {
|
||||
if device.has(key) {
|
||||
keys.push(*key);
|
||||
}
|
||||
}
|
||||
|
||||
Device {
|
||||
supported_events.insert(EventType::EV_KEY, keys);
|
||||
}
|
||||
|
||||
if device.has(&EventType::EV_REL) {
|
||||
let mut rels = Vec::new();
|
||||
|
||||
for rel in ev_rels().iter() {
|
||||
if device.has(rel) {
|
||||
rels.push(*rel);
|
||||
}
|
||||
}
|
||||
|
||||
supported_events.insert(EventType::EV_REL, rels);
|
||||
}
|
||||
|
||||
if device.has(&EventType::EV_ABS) {
|
||||
let mut abss = Vec::new();
|
||||
|
||||
for abs in ev_abss().iter() {
|
||||
if device.has(abs) {
|
||||
abss.push(*abs);
|
||||
}
|
||||
}
|
||||
|
||||
supported_events.insert(EventType::EV_ABS, abss);
|
||||
}
|
||||
|
||||
if device.has(&EventType::EV_FF) {
|
||||
let mut ffs = Vec::new();
|
||||
|
||||
for ff in ev_ffs().iter() {
|
||||
if device.has(ff) {
|
||||
ffs.push(*ff);
|
||||
}
|
||||
}
|
||||
|
||||
supported_events.insert(EventType::EV_FF, ffs);
|
||||
}
|
||||
|
||||
if device.has(&EventType::EV_FF_STATUS) {
|
||||
let mut ffss = Vec::new();
|
||||
|
||||
for ffs in ev_ffss().iter() {
|
||||
if device.has(ffs) {
|
||||
ffss.push(*ffs);
|
||||
}
|
||||
}
|
||||
|
||||
supported_events.insert(EventType::EV_FF_STATUS, ffss);
|
||||
}
|
||||
|
||||
if device.has(&EventType::EV_REP) {
|
||||
let mut reps = Vec::new();
|
||||
|
||||
for rep in ev_reps().iter() {
|
||||
if device.has(rep) {
|
||||
reps.push(*rep);
|
||||
}
|
||||
}
|
||||
|
||||
supported_events.insert(EventType::EV_REP, reps);
|
||||
}
|
||||
|
||||
Ok(Device {
|
||||
device,
|
||||
path: path.as_path().to_str().unwrap().to_string(),
|
||||
path,
|
||||
|
||||
supported_events,
|
||||
}
|
||||
})
|
||||
})
|
||||
.collect()
|
||||
}
|
||||
|
@ -124,20 +136,19 @@ impl Device {
|
|||
}
|
||||
|
||||
pub fn to_descriptor(&self) -> NodeDescriptor {
|
||||
let mut inputs = match self.supported_events.get(&EventType::FORCEFEEDBACK) {
|
||||
let mut inputs = match self.supported_events.get(&EventType::EV_FF) {
|
||||
Some(ff) => ff
|
||||
.iter()
|
||||
.map(|kind| {
|
||||
(
|
||||
format!(
|
||||
"{:?}",
|
||||
match kind {
|
||||
InputEventKind::ForceFeedback(ff) => ff,
|
||||
_ => panic!("wrong kind"),
|
||||
}
|
||||
),
|
||||
// TODO: find min and max values
|
||||
Descriptor::Slider { min: 0, max: 255 },
|
||||
format!("{:?}", kind),
|
||||
match self.device.abs_info(kind) {
|
||||
Some(abs_info) => Descriptor::Slider {
|
||||
min: abs_info.minimum,
|
||||
max: abs_info.maximum,
|
||||
},
|
||||
None => Descriptor::Button,
|
||||
},
|
||||
)
|
||||
})
|
||||
.collect(),
|
||||
|
@ -149,57 +160,44 @@ impl Device {
|
|||
.iter()
|
||||
.map(|(event_type, kinds)| {
|
||||
let t: Option<Vec<(String, Descriptor)>> = match *event_type {
|
||||
EventType::ABSOLUTE => Some(
|
||||
EventType::EV_ABS => Some(
|
||||
kinds
|
||||
.iter()
|
||||
.map(|kind| {
|
||||
(
|
||||
format!(
|
||||
"{:?}",
|
||||
match kind {
|
||||
InputEventKind::AbsAxis(axis) => axis,
|
||||
_ => panic!("wrong kind"),
|
||||
}
|
||||
),
|
||||
// TODO: find min and max values
|
||||
Descriptor::Slider { min: 0, max: 255 },
|
||||
format!("{:?}", kind),
|
||||
match self.device.abs_info(kind) {
|
||||
Some(abs_info) => Descriptor::Slider {
|
||||
min: abs_info.minimum,
|
||||
max: abs_info.maximum,
|
||||
},
|
||||
None => Descriptor::Button,
|
||||
},
|
||||
)
|
||||
})
|
||||
.collect(),
|
||||
),
|
||||
EventType::RELATIVE => Some(
|
||||
EventType::EV_REL => Some(
|
||||
kinds
|
||||
.iter()
|
||||
.map(|kind| {
|
||||
(
|
||||
format!(
|
||||
"{:?}",
|
||||
match kind {
|
||||
InputEventKind::RelAxis(axis) => axis,
|
||||
_ => panic!("wrong kind"),
|
||||
}
|
||||
),
|
||||
// TODO: find min and max values
|
||||
Descriptor::Slider { min: 0, max: 255 },
|
||||
format!("{:?}", kind),
|
||||
match self.device.abs_info(kind) {
|
||||
Some(abs_info) => Descriptor::Slider {
|
||||
min: abs_info.minimum,
|
||||
max: abs_info.maximum,
|
||||
},
|
||||
None => Descriptor::Button,
|
||||
},
|
||||
)
|
||||
})
|
||||
.collect(),
|
||||
),
|
||||
EventType::KEY => Some(
|
||||
EventType::EV_KEY => Some(
|
||||
kinds
|
||||
.iter()
|
||||
.map(|kind| {
|
||||
(
|
||||
format!(
|
||||
"{:?}",
|
||||
match kind {
|
||||
InputEventKind::Key(key) => key,
|
||||
_ => panic!("wrong kind"),
|
||||
}
|
||||
),
|
||||
Descriptor::Button,
|
||||
)
|
||||
})
|
||||
.map(|kind| (format!("{:?}", kind), Descriptor::Button))
|
||||
.collect(),
|
||||
),
|
||||
|
||||
|
|
668
src/event_code_iters.rs
Normal file
668
src/event_code_iters.rs
Normal file
|
@ -0,0 +1,668 @@
|
|||
use evdev_rs::enums::*;
|
||||
|
||||
pub fn ev_keys() -> &'static [EventCode] {
|
||||
const EVENT_CODES: [EventCode; 547] = [
|
||||
EventCode::EV_KEY(EV_KEY::KEY_RESERVED),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_ESC),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_1),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_2),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_3),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_4),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_5),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_6),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_7),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_8),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_9),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_0),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_MINUS),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_EQUAL),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_BACKSPACE),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_TAB),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_Q),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_W),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_E),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_R),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_T),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_Y),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_U),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_I),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_O),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_P),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_LEFTBRACE),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_RIGHTBRACE),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_ENTER),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_LEFTCTRL),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_A),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_S),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_D),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_F),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_G),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_H),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_J),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_K),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_L),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_SEMICOLON),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_APOSTROPHE),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_GRAVE),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_LEFTSHIFT),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_BACKSLASH),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_Z),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_X),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_C),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_V),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_B),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_N),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_M),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_COMMA),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_DOT),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_SLASH),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_RIGHTSHIFT),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_KPASTERISK),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_LEFTALT),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_SPACE),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_CAPSLOCK),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_F1),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_F2),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_F3),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_F4),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_F5),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_F6),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_F7),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_F8),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_F9),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_F10),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_NUMLOCK),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_SCROLLLOCK),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_KP7),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_KP8),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_KP9),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_KPMINUS),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_KP4),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_KP5),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_KP6),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_KPPLUS),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_KP1),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_KP2),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_KP3),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_KP0),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_KPDOT),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_ZENKAKUHANKAKU),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_102ND),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_F11),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_F12),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_RO),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_KATAKANA),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_HIRAGANA),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_HENKAN),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_KATAKANAHIRAGANA),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_MUHENKAN),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_KPJPCOMMA),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_KPENTER),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_RIGHTCTRL),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_KPSLASH),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_SYSRQ),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_RIGHTALT),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_LINEFEED),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_HOME),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_UP),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_PAGEUP),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_LEFT),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_RIGHT),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_END),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_DOWN),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_PAGEDOWN),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_INSERT),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_DELETE),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_MACRO),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_MUTE),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_VOLUMEDOWN),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_VOLUMEUP),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_POWER),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_KPEQUAL),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_KPPLUSMINUS),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_PAUSE),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_SCALE),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_KPCOMMA),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_HANGEUL),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_HANJA),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_YEN),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_LEFTMETA),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_RIGHTMETA),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_COMPOSE),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_STOP),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_AGAIN),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_PROPS),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_UNDO),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_FRONT),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_COPY),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_OPEN),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_PASTE),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_FIND),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_CUT),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_HELP),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_MENU),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_CALC),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_SETUP),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_SLEEP),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_WAKEUP),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_FILE),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_SENDFILE),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_DELETEFILE),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_XFER),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_PROG1),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_PROG2),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_WWW),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_MSDOS),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_COFFEE),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_ROTATE_DISPLAY),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_CYCLEWINDOWS),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_MAIL),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_BOOKMARKS),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_COMPUTER),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_BACK),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_FORWARD),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_CLOSECD),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_EJECTCD),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_EJECTCLOSECD),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_NEXTSONG),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_PLAYPAUSE),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_PREVIOUSSONG),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_STOPCD),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_RECORD),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_REWIND),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_PHONE),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_ISO),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_CONFIG),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_HOMEPAGE),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_REFRESH),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_EXIT),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_MOVE),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_EDIT),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_SCROLLUP),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_SCROLLDOWN),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_KPLEFTPAREN),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_KPRIGHTPAREN),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_NEW),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_REDO),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_F13),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_F14),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_F15),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_F16),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_F17),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_F18),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_F19),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_F20),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_F21),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_F22),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_F23),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_F24),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_PLAYCD),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_PAUSECD),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_PROG3),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_PROG4),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_DASHBOARD),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_SUSPEND),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_CLOSE),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_PLAY),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_FASTFORWARD),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_BASSBOOST),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_PRINT),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_HP),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_CAMERA),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_SOUND),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_QUESTION),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_EMAIL),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_CHAT),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_SEARCH),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_CONNECT),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_FINANCE),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_SPORT),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_SHOP),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_ALTERASE),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_CANCEL),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_BRIGHTNESSDOWN),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_BRIGHTNESSUP),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_MEDIA),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_SWITCHVIDEOMODE),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_KBDILLUMTOGGLE),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_KBDILLUMDOWN),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_KBDILLUMUP),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_SEND),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_REPLY),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_FORWARDMAIL),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_SAVE),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_DOCUMENTS),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_BATTERY),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_BLUETOOTH),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_WLAN),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_UWB),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_UNKNOWN),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_VIDEO_NEXT),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_VIDEO_PREV),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_BRIGHTNESS_CYCLE),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_BRIGHTNESS_AUTO),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_DISPLAY_OFF),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_WWAN),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_RFKILL),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_MICMUTE),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_OK),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_SELECT),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_GOTO),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_CLEAR),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_POWER2),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_OPTION),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_INFO),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_TIME),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_VENDOR),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_ARCHIVE),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_PROGRAM),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_CHANNEL),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_FAVORITES),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_EPG),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_PVR),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_MHP),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_LANGUAGE),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_TITLE),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_SUBTITLE),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_ANGLE),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_FULL_SCREEN),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_MODE),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_KEYBOARD),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_ASPECT_RATIO),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_PC),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_TV),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_TV2),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_VCR),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_VCR2),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_SAT),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_SAT2),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_CD),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_TAPE),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_RADIO),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_TUNER),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_PLAYER),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_TEXT),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_DVD),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_AUX),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_MP3),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_AUDIO),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_VIDEO),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_DIRECTORY),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_LIST),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_MEMO),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_CALENDAR),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_RED),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_GREEN),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_YELLOW),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_BLUE),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_CHANNELUP),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_CHANNELDOWN),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_FIRST),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_LAST),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_AB),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_NEXT),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_RESTART),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_SLOW),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_SHUFFLE),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_BREAK),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_PREVIOUS),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_DIGITS),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_TEEN),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_TWEN),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_VIDEOPHONE),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_GAMES),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_ZOOMIN),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_ZOOMOUT),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_ZOOMRESET),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_WORDPROCESSOR),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_EDITOR),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_SPREADSHEET),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_GRAPHICSEDITOR),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_PRESENTATION),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_DATABASE),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_NEWS),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_VOICEMAIL),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_ADDRESSBOOK),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_MESSENGER),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_DISPLAYTOGGLE),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_SPELLCHECK),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_LOGOFF),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_DOLLAR),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_EURO),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_FRAMEBACK),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_FRAMEFORWARD),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_CONTEXT_MENU),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_MEDIA_REPEAT),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_10CHANNELSUP),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_10CHANNELSDOWN),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_IMAGES),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_DEL_EOL),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_DEL_EOS),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_INS_LINE),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_DEL_LINE),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_FN),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_FN_ESC),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_FN_F1),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_FN_F2),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_FN_F3),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_FN_F4),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_FN_F5),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_FN_F6),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_FN_F7),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_FN_F8),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_FN_F9),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_FN_F10),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_FN_F11),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_FN_F12),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_FN_1),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_FN_2),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_FN_D),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_FN_E),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_FN_F),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_FN_S),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_FN_B),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_BRL_DOT1),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_BRL_DOT2),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_BRL_DOT3),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_BRL_DOT4),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_BRL_DOT5),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_BRL_DOT6),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_BRL_DOT7),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_BRL_DOT8),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_BRL_DOT9),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_BRL_DOT10),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_NUMERIC_0),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_NUMERIC_1),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_NUMERIC_2),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_NUMERIC_3),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_NUMERIC_4),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_NUMERIC_5),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_NUMERIC_6),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_NUMERIC_7),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_NUMERIC_8),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_NUMERIC_9),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_NUMERIC_STAR),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_NUMERIC_POUND),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_NUMERIC_A),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_NUMERIC_B),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_NUMERIC_C),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_NUMERIC_D),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_CAMERA_FOCUS),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_WPS_BUTTON),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_TOUCHPAD_TOGGLE),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_TOUCHPAD_ON),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_TOUCHPAD_OFF),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_CAMERA_ZOOMIN),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_CAMERA_ZOOMOUT),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_CAMERA_UP),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_CAMERA_DOWN),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_CAMERA_LEFT),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_CAMERA_RIGHT),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_ATTENDANT_ON),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_ATTENDANT_OFF),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_ATTENDANT_TOGGLE),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_LIGHTS_TOGGLE),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_ALS_TOGGLE),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_ROTATE_LOCK_TOGGLE),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_BUTTONCONFIG),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_TASKMANAGER),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_JOURNAL),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_CONTROLPANEL),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_APPSELECT),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_SCREENSAVER),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_VOICECOMMAND),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_ASSISTANT),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_KBD_LAYOUT_NEXT),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_BRIGHTNESS_MIN),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_BRIGHTNESS_MAX),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_KBDINPUTASSIST_PREV),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_KBDINPUTASSIST_NEXT),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_KBDINPUTASSIST_PREVGROUP),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_KBDINPUTASSIST_NEXTGROUP),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_KBDINPUTASSIST_ACCEPT),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_KBDINPUTASSIST_CANCEL),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_RIGHT_UP),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_RIGHT_DOWN),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_LEFT_UP),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_LEFT_DOWN),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_ROOT_MENU),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_MEDIA_TOP_MENU),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_NUMERIC_11),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_NUMERIC_12),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_AUDIO_DESC),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_3D_MODE),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_NEXT_FAVORITE),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_STOP_RECORD),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_PAUSE_RECORD),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_VOD),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_UNMUTE),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_FASTREVERSE),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_SLOWREVERSE),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_DATA),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_ONSCREEN_KEYBOARD),
|
||||
EventCode::EV_KEY(EV_KEY::KEY_MAX),
|
||||
EventCode::EV_KEY(EV_KEY::BTN_0),
|
||||
EventCode::EV_KEY(EV_KEY::BTN_1),
|
||||
EventCode::EV_KEY(EV_KEY::BTN_2),
|
||||
EventCode::EV_KEY(EV_KEY::BTN_3),
|
||||
EventCode::EV_KEY(EV_KEY::BTN_4),
|
||||
EventCode::EV_KEY(EV_KEY::BTN_5),
|
||||
EventCode::EV_KEY(EV_KEY::BTN_6),
|
||||
EventCode::EV_KEY(EV_KEY::BTN_7),
|
||||
EventCode::EV_KEY(EV_KEY::BTN_8),
|
||||
EventCode::EV_KEY(EV_KEY::BTN_9),
|
||||
EventCode::EV_KEY(EV_KEY::BTN_LEFT),
|
||||
EventCode::EV_KEY(EV_KEY::BTN_RIGHT),
|
||||
EventCode::EV_KEY(EV_KEY::BTN_MIDDLE),
|
||||
EventCode::EV_KEY(EV_KEY::BTN_SIDE),
|
||||
EventCode::EV_KEY(EV_KEY::BTN_EXTRA),
|
||||
EventCode::EV_KEY(EV_KEY::BTN_FORWARD),
|
||||
EventCode::EV_KEY(EV_KEY::BTN_BACK),
|
||||
EventCode::EV_KEY(EV_KEY::BTN_TASK),
|
||||
EventCode::EV_KEY(EV_KEY::BTN_TRIGGER),
|
||||
EventCode::EV_KEY(EV_KEY::BTN_THUMB),
|
||||
EventCode::EV_KEY(EV_KEY::BTN_THUMB2),
|
||||
EventCode::EV_KEY(EV_KEY::BTN_TOP),
|
||||
EventCode::EV_KEY(EV_KEY::BTN_TOP2),
|
||||
EventCode::EV_KEY(EV_KEY::BTN_PINKIE),
|
||||
EventCode::EV_KEY(EV_KEY::BTN_BASE),
|
||||
EventCode::EV_KEY(EV_KEY::BTN_BASE2),
|
||||
EventCode::EV_KEY(EV_KEY::BTN_BASE3),
|
||||
EventCode::EV_KEY(EV_KEY::BTN_BASE4),
|
||||
EventCode::EV_KEY(EV_KEY::BTN_BASE5),
|
||||
EventCode::EV_KEY(EV_KEY::BTN_BASE6),
|
||||
EventCode::EV_KEY(EV_KEY::BTN_DEAD),
|
||||
EventCode::EV_KEY(EV_KEY::BTN_SOUTH),
|
||||
EventCode::EV_KEY(EV_KEY::BTN_EAST),
|
||||
EventCode::EV_KEY(EV_KEY::BTN_C),
|
||||
EventCode::EV_KEY(EV_KEY::BTN_NORTH),
|
||||
EventCode::EV_KEY(EV_KEY::BTN_WEST),
|
||||
EventCode::EV_KEY(EV_KEY::BTN_Z),
|
||||
EventCode::EV_KEY(EV_KEY::BTN_TL),
|
||||
EventCode::EV_KEY(EV_KEY::BTN_TR),
|
||||
EventCode::EV_KEY(EV_KEY::BTN_TL2),
|
||||
EventCode::EV_KEY(EV_KEY::BTN_TR2),
|
||||
EventCode::EV_KEY(EV_KEY::BTN_SELECT),
|
||||
EventCode::EV_KEY(EV_KEY::BTN_START),
|
||||
EventCode::EV_KEY(EV_KEY::BTN_MODE),
|
||||
EventCode::EV_KEY(EV_KEY::BTN_THUMBL),
|
||||
EventCode::EV_KEY(EV_KEY::BTN_THUMBR),
|
||||
EventCode::EV_KEY(EV_KEY::BTN_TOOL_PEN),
|
||||
EventCode::EV_KEY(EV_KEY::BTN_TOOL_RUBBER),
|
||||
EventCode::EV_KEY(EV_KEY::BTN_TOOL_BRUSH),
|
||||
EventCode::EV_KEY(EV_KEY::BTN_TOOL_PENCIL),
|
||||
EventCode::EV_KEY(EV_KEY::BTN_TOOL_AIRBRUSH),
|
||||
EventCode::EV_KEY(EV_KEY::BTN_TOOL_FINGER),
|
||||
EventCode::EV_KEY(EV_KEY::BTN_TOOL_MOUSE),
|
||||
EventCode::EV_KEY(EV_KEY::BTN_TOOL_LENS),
|
||||
EventCode::EV_KEY(EV_KEY::BTN_TOOL_QUINTTAP),
|
||||
EventCode::EV_KEY(EV_KEY::BTN_STYLUS3),
|
||||
EventCode::EV_KEY(EV_KEY::BTN_TOUCH),
|
||||
EventCode::EV_KEY(EV_KEY::BTN_STYLUS),
|
||||
EventCode::EV_KEY(EV_KEY::BTN_STYLUS2),
|
||||
EventCode::EV_KEY(EV_KEY::BTN_TOOL_DOUBLETAP),
|
||||
EventCode::EV_KEY(EV_KEY::BTN_TOOL_TRIPLETAP),
|
||||
EventCode::EV_KEY(EV_KEY::BTN_TOOL_QUADTAP),
|
||||
EventCode::EV_KEY(EV_KEY::BTN_GEAR_DOWN),
|
||||
EventCode::EV_KEY(EV_KEY::BTN_GEAR_UP),
|
||||
EventCode::EV_KEY(EV_KEY::BTN_DPAD_UP),
|
||||
EventCode::EV_KEY(EV_KEY::BTN_DPAD_DOWN),
|
||||
EventCode::EV_KEY(EV_KEY::BTN_DPAD_LEFT),
|
||||
EventCode::EV_KEY(EV_KEY::BTN_DPAD_RIGHT),
|
||||
EventCode::EV_KEY(EV_KEY::BTN_TRIGGER_HAPPY1),
|
||||
EventCode::EV_KEY(EV_KEY::BTN_TRIGGER_HAPPY2),
|
||||
EventCode::EV_KEY(EV_KEY::BTN_TRIGGER_HAPPY3),
|
||||
EventCode::EV_KEY(EV_KEY::BTN_TRIGGER_HAPPY4),
|
||||
EventCode::EV_KEY(EV_KEY::BTN_TRIGGER_HAPPY5),
|
||||
EventCode::EV_KEY(EV_KEY::BTN_TRIGGER_HAPPY6),
|
||||
EventCode::EV_KEY(EV_KEY::BTN_TRIGGER_HAPPY7),
|
||||
EventCode::EV_KEY(EV_KEY::BTN_TRIGGER_HAPPY8),
|
||||
EventCode::EV_KEY(EV_KEY::BTN_TRIGGER_HAPPY9),
|
||||
EventCode::EV_KEY(EV_KEY::BTN_TRIGGER_HAPPY10),
|
||||
EventCode::EV_KEY(EV_KEY::BTN_TRIGGER_HAPPY11),
|
||||
EventCode::EV_KEY(EV_KEY::BTN_TRIGGER_HAPPY12),
|
||||
EventCode::EV_KEY(EV_KEY::BTN_TRIGGER_HAPPY13),
|
||||
EventCode::EV_KEY(EV_KEY::BTN_TRIGGER_HAPPY14),
|
||||
EventCode::EV_KEY(EV_KEY::BTN_TRIGGER_HAPPY15),
|
||||
EventCode::EV_KEY(EV_KEY::BTN_TRIGGER_HAPPY16),
|
||||
EventCode::EV_KEY(EV_KEY::BTN_TRIGGER_HAPPY17),
|
||||
EventCode::EV_KEY(EV_KEY::BTN_TRIGGER_HAPPY18),
|
||||
EventCode::EV_KEY(EV_KEY::BTN_TRIGGER_HAPPY19),
|
||||
EventCode::EV_KEY(EV_KEY::BTN_TRIGGER_HAPPY20),
|
||||
EventCode::EV_KEY(EV_KEY::BTN_TRIGGER_HAPPY21),
|
||||
EventCode::EV_KEY(EV_KEY::BTN_TRIGGER_HAPPY22),
|
||||
EventCode::EV_KEY(EV_KEY::BTN_TRIGGER_HAPPY23),
|
||||
EventCode::EV_KEY(EV_KEY::BTN_TRIGGER_HAPPY24),
|
||||
EventCode::EV_KEY(EV_KEY::BTN_TRIGGER_HAPPY25),
|
||||
EventCode::EV_KEY(EV_KEY::BTN_TRIGGER_HAPPY26),
|
||||
EventCode::EV_KEY(EV_KEY::BTN_TRIGGER_HAPPY27),
|
||||
EventCode::EV_KEY(EV_KEY::BTN_TRIGGER_HAPPY28),
|
||||
EventCode::EV_KEY(EV_KEY::BTN_TRIGGER_HAPPY29),
|
||||
EventCode::EV_KEY(EV_KEY::BTN_TRIGGER_HAPPY30),
|
||||
EventCode::EV_KEY(EV_KEY::BTN_TRIGGER_HAPPY31),
|
||||
EventCode::EV_KEY(EV_KEY::BTN_TRIGGER_HAPPY32),
|
||||
EventCode::EV_KEY(EV_KEY::BTN_TRIGGER_HAPPY33),
|
||||
EventCode::EV_KEY(EV_KEY::BTN_TRIGGER_HAPPY34),
|
||||
EventCode::EV_KEY(EV_KEY::BTN_TRIGGER_HAPPY35),
|
||||
EventCode::EV_KEY(EV_KEY::BTN_TRIGGER_HAPPY36),
|
||||
EventCode::EV_KEY(EV_KEY::BTN_TRIGGER_HAPPY37),
|
||||
EventCode::EV_KEY(EV_KEY::BTN_TRIGGER_HAPPY38),
|
||||
EventCode::EV_KEY(EV_KEY::BTN_TRIGGER_HAPPY39),
|
||||
EventCode::EV_KEY(EV_KEY::BTN_TRIGGER_HAPPY40),
|
||||
];
|
||||
|
||||
&EVENT_CODES
|
||||
}
|
||||
|
||||
pub fn ev_rels() -> &'static [EventCode] {
|
||||
const EVENT_CODES: [EventCode; 14] = [
|
||||
EventCode::EV_REL(EV_REL::REL_X),
|
||||
EventCode::EV_REL(EV_REL::REL_Y),
|
||||
EventCode::EV_REL(EV_REL::REL_Z),
|
||||
EventCode::EV_REL(EV_REL::REL_RX),
|
||||
EventCode::EV_REL(EV_REL::REL_RY),
|
||||
EventCode::EV_REL(EV_REL::REL_RZ),
|
||||
EventCode::EV_REL(EV_REL::REL_HWHEEL),
|
||||
EventCode::EV_REL(EV_REL::REL_DIAL),
|
||||
EventCode::EV_REL(EV_REL::REL_WHEEL),
|
||||
EventCode::EV_REL(EV_REL::REL_MISC),
|
||||
EventCode::EV_REL(EV_REL::REL_RESERVED),
|
||||
EventCode::EV_REL(EV_REL::REL_WHEEL_HI_RES),
|
||||
EventCode::EV_REL(EV_REL::REL_HWHEEL_HI_RES),
|
||||
EventCode::EV_REL(EV_REL::REL_MAX),
|
||||
];
|
||||
|
||||
&EVENT_CODES
|
||||
}
|
||||
|
||||
pub fn ev_abss() -> &'static [EventCode] {
|
||||
const EVENT_CODES: [EventCode; 43] = [
|
||||
EventCode::EV_ABS(EV_ABS::ABS_X),
|
||||
EventCode::EV_ABS(EV_ABS::ABS_Y),
|
||||
EventCode::EV_ABS(EV_ABS::ABS_Z),
|
||||
EventCode::EV_ABS(EV_ABS::ABS_RX),
|
||||
EventCode::EV_ABS(EV_ABS::ABS_RY),
|
||||
EventCode::EV_ABS(EV_ABS::ABS_RZ),
|
||||
EventCode::EV_ABS(EV_ABS::ABS_THROTTLE),
|
||||
EventCode::EV_ABS(EV_ABS::ABS_RUDDER),
|
||||
EventCode::EV_ABS(EV_ABS::ABS_WHEEL),
|
||||
EventCode::EV_ABS(EV_ABS::ABS_GAS),
|
||||
EventCode::EV_ABS(EV_ABS::ABS_BRAKE),
|
||||
EventCode::EV_ABS(EV_ABS::ABS_HAT0X),
|
||||
EventCode::EV_ABS(EV_ABS::ABS_HAT0Y),
|
||||
EventCode::EV_ABS(EV_ABS::ABS_HAT1X),
|
||||
EventCode::EV_ABS(EV_ABS::ABS_HAT1Y),
|
||||
EventCode::EV_ABS(EV_ABS::ABS_HAT2X),
|
||||
EventCode::EV_ABS(EV_ABS::ABS_HAT2Y),
|
||||
EventCode::EV_ABS(EV_ABS::ABS_HAT3X),
|
||||
EventCode::EV_ABS(EV_ABS::ABS_HAT3Y),
|
||||
EventCode::EV_ABS(EV_ABS::ABS_PRESSURE),
|
||||
EventCode::EV_ABS(EV_ABS::ABS_DISTANCE),
|
||||
EventCode::EV_ABS(EV_ABS::ABS_TILT_X),
|
||||
EventCode::EV_ABS(EV_ABS::ABS_TILT_Y),
|
||||
EventCode::EV_ABS(EV_ABS::ABS_TOOL_WIDTH),
|
||||
EventCode::EV_ABS(EV_ABS::ABS_VOLUME),
|
||||
EventCode::EV_ABS(EV_ABS::ABS_MISC),
|
||||
EventCode::EV_ABS(EV_ABS::ABS_RESERVED),
|
||||
EventCode::EV_ABS(EV_ABS::ABS_MT_SLOT),
|
||||
EventCode::EV_ABS(EV_ABS::ABS_MT_TOUCH_MAJOR),
|
||||
EventCode::EV_ABS(EV_ABS::ABS_MT_TOUCH_MINOR),
|
||||
EventCode::EV_ABS(EV_ABS::ABS_MT_WIDTH_MAJOR),
|
||||
EventCode::EV_ABS(EV_ABS::ABS_MT_WIDTH_MINOR),
|
||||
EventCode::EV_ABS(EV_ABS::ABS_MT_ORIENTATION),
|
||||
EventCode::EV_ABS(EV_ABS::ABS_MT_POSITION_X),
|
||||
EventCode::EV_ABS(EV_ABS::ABS_MT_POSITION_Y),
|
||||
EventCode::EV_ABS(EV_ABS::ABS_MT_TOOL_TYPE),
|
||||
EventCode::EV_ABS(EV_ABS::ABS_MT_BLOB_ID),
|
||||
EventCode::EV_ABS(EV_ABS::ABS_MT_TRACKING_ID),
|
||||
EventCode::EV_ABS(EV_ABS::ABS_MT_PRESSURE),
|
||||
EventCode::EV_ABS(EV_ABS::ABS_MT_DISTANCE),
|
||||
EventCode::EV_ABS(EV_ABS::ABS_MT_TOOL_X),
|
||||
EventCode::EV_ABS(EV_ABS::ABS_MT_TOOL_Y),
|
||||
EventCode::EV_ABS(EV_ABS::ABS_MAX),
|
||||
];
|
||||
|
||||
&EVENT_CODES
|
||||
}
|
||||
|
||||
pub fn ev_ffs() -> &'static [EventCode] {
|
||||
const EVENT_CODES: [EventCode; 17] = [
|
||||
EventCode::EV_FF(EV_FF::FF_RUMBLE),
|
||||
EventCode::EV_FF(EV_FF::FF_PERIODIC),
|
||||
EventCode::EV_FF(EV_FF::FF_CONSTANT),
|
||||
EventCode::EV_FF(EV_FF::FF_SPRING),
|
||||
EventCode::EV_FF(EV_FF::FF_FRICTION),
|
||||
EventCode::EV_FF(EV_FF::FF_DAMPER),
|
||||
EventCode::EV_FF(EV_FF::FF_INERTIA),
|
||||
EventCode::EV_FF(EV_FF::FF_RAMP),
|
||||
EventCode::EV_FF(EV_FF::FF_SQUARE),
|
||||
EventCode::EV_FF(EV_FF::FF_TRIANGLE),
|
||||
EventCode::EV_FF(EV_FF::FF_SINE),
|
||||
EventCode::EV_FF(EV_FF::FF_SAW_UP),
|
||||
EventCode::EV_FF(EV_FF::FF_SAW_DOWN),
|
||||
EventCode::EV_FF(EV_FF::FF_CUSTOM),
|
||||
EventCode::EV_FF(EV_FF::FF_GAIN),
|
||||
EventCode::EV_FF(EV_FF::FF_AUTOCENTER),
|
||||
EventCode::EV_FF(EV_FF::FF_MAX),
|
||||
];
|
||||
|
||||
&EVENT_CODES
|
||||
}
|
||||
|
||||
pub fn ev_ffss() -> &'static [EventCode] {
|
||||
const EVENT_CODES: [EventCode; 2] = [
|
||||
EventCode::EV_FF_STATUS(EV_FF::FF_STATUS_STOPPED),
|
||||
EventCode::EV_FF_STATUS(EV_FF::FF_STATUS_PLAYING),
|
||||
];
|
||||
|
||||
&EVENT_CODES
|
||||
}
|
||||
|
||||
pub fn ev_reps() -> &'static [EventCode] {
|
||||
const EVENT_CODES: [EventCode; 2] = [
|
||||
EventCode::EV_REP(EV_REP::REP_DELAY),
|
||||
EventCode::EV_REP(EV_REP::REP_PERIOD),
|
||||
];
|
||||
|
||||
&EVENT_CODES
|
||||
}
|
|
@ -5,6 +5,7 @@ mod graph_node_ui;
|
|||
mod color_hex_utils;
|
||||
mod device;
|
||||
mod editor_state;
|
||||
mod event_code_iters;
|
||||
mod graph_editor_egui;
|
||||
mod graph_impls;
|
||||
mod graph_types;
|
||||
|
@ -28,7 +29,7 @@ impl App {
|
|||
fn new() -> Self {
|
||||
Self {
|
||||
state: GraphEditorState::default(),
|
||||
devices: Device::query(),
|
||||
devices: Device::query().unwrap(),
|
||||
virtual_device: None,
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue