tool: Add a system76_ec command to disable input events
For testing Launch keyboards. Could easily support in EC firmware as well if we had a use for that, but not adding that for now.
This commit is contained in:
@ -377,6 +377,12 @@ fn main() {
|
||||
.multiple(true)
|
||||
)
|
||||
)
|
||||
.subcommand(SubCommand::with_name("set_no_input")
|
||||
.arg(Arg::with_name("value")
|
||||
.possible_values(&["true", "false"])
|
||||
.required(true)
|
||||
)
|
||||
)
|
||||
.get_matches();
|
||||
|
||||
let get_ec = || -> Result<_, Error> {
|
||||
@ -596,6 +602,16 @@ fn main() {
|
||||
},
|
||||
}
|
||||
},
|
||||
("set_no_input", Some(sub_m)) => {
|
||||
let no_input = sub_m.value_of("value").unwrap().parse::<bool>().unwrap();
|
||||
match unsafe { ec.set_no_input(no_input) } {
|
||||
Ok(()) => (),
|
||||
Err(err) => {
|
||||
eprintln!("failed to set no_input mode: {:X?}", err);
|
||||
process::exit(1);
|
||||
}
|
||||
}
|
||||
}
|
||||
_ => unreachable!()
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user