Limit input size
This commit is contained in:
parent
00ea1759d4
commit
55fe2fb538
@ -392,10 +392,12 @@ fn start_keyboard_input_thread(
|
||||
.unwrap();
|
||||
}
|
||||
Event::Key(Key::Char(c)) => {
|
||||
buffer.push_str(&c.to_string());
|
||||
display_sender
|
||||
.send(DisplayMessage::Input(Key::Char(c)))
|
||||
.unwrap();
|
||||
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();
|
||||
|
Loading…
Reference in New Issue
Block a user