Fix: Enter instead of ?
This commit is contained in:
parent
a2109db431
commit
6f09d16593
|
@ -95,11 +95,15 @@ pub async fn return_keychar() {
|
|||
if let Some(key) = keyboard.process_keyevent(key_event) {
|
||||
match key {
|
||||
DecodedKey::Unicode(character) => (
|
||||
match character {
|
||||
'?' => { println!(); command_func(command); command = "".to_string(); print!("> "); }
|
||||
char => { print!("{}", char); command.push(char); serial_print!("{:?}", char); }
|
||||
}
|
||||
|
||||
if scancode == 28 { // 28 is keycode for Enter key
|
||||
println!();
|
||||
command_func(command);
|
||||
command = "".to_string();
|
||||
print!("> ");
|
||||
} else {
|
||||
print!("{}", character);
|
||||
command.push(character);
|
||||
}
|
||||
),
|
||||
DecodedKey::RawKey(key) => serial_print!("{:?}", key),
|
||||
};
|
||||
|
@ -117,7 +121,7 @@ fn command_func(command: String) {
|
|||
println!("wow!!");
|
||||
}
|
||||
command => {
|
||||
println!("I don't know that command");
|
||||
println!("{}: command not found", command);
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue