Fix: Enter instead of ?

This commit is contained in:
g1n 2021-07-26 16:37:17 +03:00
parent a2109db431
commit 6f09d16593
1 changed files with 10 additions and 6 deletions

View File

@ -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);
}
}
}