|
|
|
|
@ -5,7 +5,15 @@ pub fn pedals() -> Vec<Pedal> {
|
|
|
|
|
vec![
|
|
|
|
|
Pedal {
|
|
|
|
|
key: Key::BTN_SIDE,
|
|
|
|
|
action: Box::new(|tx| ()),
|
|
|
|
|
action: Box::new(|tx| {
|
|
|
|
|
let code = Key::KEY_SPACE.code();
|
|
|
|
|
let down_event = InputEvent::new(EventType::KEY, code, 1);
|
|
|
|
|
let up_event = InputEvent::new(EventType::KEY, code, 0);
|
|
|
|
|
tx.send(down_event).unwrap();
|
|
|
|
|
std::thread::sleep(std::time::Duration::from_millis(26));
|
|
|
|
|
tx.send(up_event).unwrap();
|
|
|
|
|
std::thread::sleep(std::time::Duration::from_millis(31));
|
|
|
|
|
}),
|
|
|
|
|
},
|
|
|
|
|
Pedal {
|
|
|
|
|
key: Key::BTN_EXTRA,
|
|
|
|
|
@ -21,7 +29,15 @@ pub fn pedals() -> Vec<Pedal> {
|
|
|
|
|
},
|
|
|
|
|
Pedal {
|
|
|
|
|
key: Key::BTN_RIGHT,
|
|
|
|
|
action: Box::new(|tx| ()),
|
|
|
|
|
action: Box::new(|tx| {
|
|
|
|
|
let code = Key::BTN_LEFT.code();
|
|
|
|
|
let down_event = InputEvent::new(EventType::KEY, code, 1);
|
|
|
|
|
let up_event = InputEvent::new(EventType::KEY, code, 0);
|
|
|
|
|
tx.send(down_event).unwrap();
|
|
|
|
|
std::thread::sleep(std::time::Duration::from_millis(19));
|
|
|
|
|
tx.send(up_event).unwrap();
|
|
|
|
|
std::thread::sleep(std::time::Duration::from_millis(26));
|
|
|
|
|
}),
|
|
|
|
|
},
|
|
|
|
|
]
|
|
|
|
|
}
|
|
|
|
|
|