Added types and append_string command

Application is now able to set the types (Key, Mouse, MouseKey, String),
which are saved in a struct, with a function. Furthermore, the
application can check the returned type of the board with a match.

This commit also implements the append string functionallity.
This commit is contained in:
2018-07-31 00:34:35 +02:00
parent 6e05947498
commit 897bb28db5
3 changed files with 156 additions and 11 deletions

View File

@@ -128,14 +128,15 @@ fn main() {
for (i, cmd) in cmd_list.iter().enumerate() {
match cmd as &str {
"wr_key" => {
pedals.set_key(i, val_list[i].as_str());
"set_key" => {
pedals.set_key(ped_list[i] as usize, val_list[i].as_str());
}
"del_key" => {
}
"append_key" => {
}
"append_str" => {
pedals.set_string(ped_list[i] as usize, val_list[i].as_str());
}
_ => {
error!("Unkonwn command!");