Limit input size

This commit is contained in:
Artlef 2020-11-29 15:49:01 +01:00
parent 00ea1759d4
commit 55fe2fb538

View File

@ -392,11 +392,13 @@ fn start_keyboard_input_thread(
.unwrap();
}
Event::Key(Key::Char(c)) => {
if buffer.len() < 10 {
buffer.push_str(&c.to_string());
display_sender
.send(DisplayMessage::Input(Key::Char(c)))
.unwrap();
}
}
Event::Key(Key::Backspace) => {
buffer.pop();
display_sender