Try all possible uinput paths

This commit is contained in:
Travis Burtrum 2017-11-06 23:18:54 -05:00
parent 00c617307f
commit 3dfeed33e0
1 changed files with 7 additions and 5 deletions

View File

@ -43,11 +43,13 @@ fn main() {
let key_map = KeyMaps::key_map();
//println!("key_map: {:?}", key_map);
let device = rusty_keys::default().expect("1")
let device = rusty_keys::default()
.or_else(|_| rusty_keys::open("/dev/uinput"))
.or_else(|_| rusty_keys::open("/dev/input/uinput"))
.expect("cannot open uinput device")
.name("test").expect("cannot name uinput device")
.event(key_map.values()).expect("cannot register events on uinput device")
.create().expect("cannot create uinput device");