Fix double key register on dbbootlogd

This commit is contained in:
Wildan M
2025-10-22 17:02:03 +07:00
parent 306079c091
commit 6c9822893e
2 changed files with 7 additions and 4 deletions
+3 -3
View File
@@ -263,11 +263,11 @@ impl TextScreen {
pub struct TextBuffer {
pub lines: VecDeque<Vec<u8>>,
pub lines_max: u32,
pub lines_max: usize,
}
impl TextBuffer {
pub fn new(max: u32) -> Self {
pub fn new(max: usize) -> Self {
let mut lines = VecDeque::new();
lines.push_back(Vec::new());
Self {
@@ -288,7 +288,7 @@ impl TextBuffer {
}
}
let max_len = self.lines_max as usize;
let max_len = self.lines_max;
while self.lines.len() > max_len {
self.lines.pop_front();
}
+4 -1
View File
@@ -74,6 +74,9 @@ impl FbbootlogScheme {
pub fn handle_input(&mut self, ev: &Event) {
match ev.to_option() {
EventOption::Key(key_event) => {
if !key_event.pressed {
return;
}
match key_event.scancode {
0x48 => {
// Up
@@ -103,7 +106,7 @@ impl FbbootlogScheme {
}
0x4F => {
// End
self.scrollback_offset = 1000;
self.scrollback_offset = self.text_buffer.lines_max;
}
_ => return,
}