Fix double key register on dbbootlogd
This commit is contained in:
@@ -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();
|
||||
}
|
||||
|
||||
@@ -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,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user