wallet: editbox home/end keys

This commit is contained in:
darkfi
2024-07-10 12:00:19 +02:00
parent 8e54b470bd
commit f28500c36a

View File

@@ -965,6 +965,17 @@ impl EditBox {
self.apply_cursor_scrolling();
self.redraw().await;
}
KeyCode::Home => {
self.cursor_pos.set(0);
self.apply_cursor_scrolling();
self.redraw().await;
}
KeyCode::End => {
let glyphs_len = self.glyphs.lock().unwrap().len();
self.cursor_pos.set(glyphs_len as u32);
self.apply_cursor_scrolling();
self.redraw().await;
}
_ => {}
}
}
@@ -1252,4 +1263,6 @@ static ALLOWED_KEYCODES: &'static [KeyCode] = &[
KeyCode::KpEnter,
KeyCode::Delete,
KeyCode::Backspace,
KeyCode::Home,
KeyCode::End,
];