master
rrr-marble 4 years ago
parent 42c9dc3a80
commit 5dad8b2127

@ -4,7 +4,6 @@ version = "0.2.1"
authors = ["rrr-marble <rrr@marble.lan>"] authors = ["rrr-marble <rrr@marble.lan>"]
edition = "2018" edition = "2018"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies] [dependencies]
evdev = "0.11.1" evdev = "0.11.1"

@ -14,9 +14,13 @@ symbols or meanings takes place.
As such this program requires access to /dev/input and /dev/uinput interfaces. As such this program requires access to /dev/input and /dev/uinput interfaces.
It can be granted by input and uinput user groups or superuser privileges. It can be granted by input and uinput user groups or superuser privileges.
Grabs input device through a kernel syscall. This prevents other devices
(including kernel-internal ones such as rfkill) from receiving events
from the device.
# Usage # Usage
./dpk [/PATH/TO/INPUT/DEVICE] dpk [/PATH/TO/INPUT/DEVICE]
*/ */
use std::io::Write; //for .flush() use std::io::Write; //for .flush()

@ -5,8 +5,8 @@
pub use crate::Pedal; pub use crate::Pedal;
use evdev::{EventType, InputEvent, Key}; use evdev::{EventType, InputEvent, Key};
/// Repeatedly press the key with given intervals /// Press and release the key with given intervals
/// and send these keypresses into transmit channel /// then send these keypresses into transmit channel
/// mash! (key to press, /// mash! (key to press,
/// down time(while pressed), /// down time(while pressed),
/// up time(between presses), /// up time(between presses),
@ -91,6 +91,7 @@ pub fn pedals() -> Vec<Pedal> {
] ]
} }
/// Returns a vector of currently requred for pedals virtual buttons
pub fn buttons() -> Vec<evdev::Key> { pub fn buttons() -> Vec<evdev::Key> {
vec![ vec![
Key::KEY_F, Key::KEY_F,

Loading…
Cancel
Save