summaryrefslogtreecommitdiffstats
path: root/rsnix/src/ps2.rs
diff options
context:
space:
mode:
authorsalmonik <salmonik@tuta.io>2026-07-31 17:28:31 +0200
committersalmonik <salmonik@tuta.io>2026-07-31 17:28:31 +0200
commit994a2196745637fd0805132711b1ed9354b75426 (patch)
treec666940f060aa8db028c75fd3aef799fabbd69b4 /rsnix/src/ps2.rs
parenttty + vt terminal split, rsdosedit editor (1:1 UNIX console) (diff)
downloadrs-dos-994a2196745637fd0805132711b1ed9354b75426.tar.gz
rs-dos-994a2196745637fd0805132711b1ed9354b75426.zip
vt: decode UTF-8, render box-drawing/arrow glyphs procedurally
The editor's gutter '│' (U+2502) appeared as '???' — write_bytes fed each UTF-8 byte to the state machine, which mapped every byte >= 0x80 to '?', and the Latin-1 font has no box-drawing glyphs anyway. - vt.write_bytes now decodes UTF-8 sequences; printable non-ASCII dispatches to the glyph path instead of the byte parser. - gop: unicode_glyph_bits() procedurally rasterises box-drawing (U+2500-257F light/heavy/double), arrows (U+2190-2193) and the em dash (U+2014) — pure geometry, no font data needed; blit_glyph falls back to it for ch >= 256. Verified via framebuffer dumps: editor gutter │ renders as a vertical line, help screen ═ separators and ←→↑↓ all render as lines (no '?'). Shell banner em dash renders too.
Diffstat (limited to '')
-rw-r--r--rsnix/src/ps2.rs24
1 files changed, 20 insertions, 4 deletions
diff --git a/rsnix/src/ps2.rs b/rsnix/src/ps2.rs
index 8dd58a0..4747813 100644
--- a/rsnix/src/ps2.rs
+++ b/rsnix/src/ps2.rs
@@ -337,10 +337,26 @@ fn process_e0(byte: u8) -> Option<KeyEvent> {
337 update_modifiers(byte, true, true); 337 update_modifiers(byte, true, true);
338 338
339 match byte { 339 match byte {
340 0x48 => Some(if ctrl_held() { KeyEvent::CtrlArrow(0) } else { KeyEvent::ArrowUp }), 340 0x48 => Some(if ctrl_held() {
341 0x50 => Some(if ctrl_held() { KeyEvent::CtrlArrow(1) } else { KeyEvent::ArrowDown }), 341 KeyEvent::CtrlArrow(0)
342 0x4B => Some(if ctrl_held() { KeyEvent::CtrlArrow(2) } else { KeyEvent::ArrowLeft }), 342 } else {
343 0x4D => Some(if ctrl_held() { KeyEvent::CtrlArrow(3) } else { KeyEvent::ArrowRight }), 343 KeyEvent::ArrowUp
344 }),
345 0x50 => Some(if ctrl_held() {
346 KeyEvent::CtrlArrow(1)
347 } else {
348 KeyEvent::ArrowDown
349 }),
350 0x4B => Some(if ctrl_held() {
351 KeyEvent::CtrlArrow(2)
352 } else {
353 KeyEvent::ArrowLeft
354 }),
355 0x4D => Some(if ctrl_held() {
356 KeyEvent::CtrlArrow(3)
357 } else {
358 KeyEvent::ArrowRight
359 }),
344 0x47 => Some(KeyEvent::Home), 360 0x47 => Some(KeyEvent::Home),
345 0x4F => Some(KeyEvent::End), 361 0x4F => Some(KeyEvent::End),
346 0x49 => Some(KeyEvent::PageUp), 362 0x49 => Some(KeyEvent::PageUp),