From 85e63eb51c6b5bf1c955104ffa97ad1298e47d9b Mon Sep 17 00:00:00 2001 From: Able Date: Tue, 5 Nov 2024 22:16:08 -0600 Subject: [PATCH] Add backspace --- sysdata/programs/render_example/src/examples/text.hb | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/sysdata/programs/render_example/src/examples/text.hb b/sysdata/programs/render_example/src/examples/text.hb index f13770f..d049034 100644 --- a/sysdata/programs/render_example/src/examples/text.hb +++ b/sysdata/programs/render_example/src/examples/text.hb @@ -39,7 +39,6 @@ example := fn(): void { color := render.white prev_input := 250 - loop { input := memory.inb(96) if input != prev_input { @@ -59,13 +58,20 @@ example := fn(): void { color = render.blue } else if char == 0x77 { color = render.white + } else if char == 0xE { + cursor -= 1; + *cursor = 32 + + continue }; *cursor = char cursor += 1 } } render.clear(screen, render.black) + render.put_rect(screen, .(0, 0), .(screen.width - 1, screen.height - 1), render.white) render.put_text(screen, font, .(0, 0), color, buf) + render.sync(screen) } @@ -99,6 +105,8 @@ map_keys := fn(inp: u8): u8 { return 0x2D } else if inp == 0xD { return 0x3D + } else if inp == 0xE { + return 0xE } else if inp == 0x1C { return 0xA } else if inp == 0x10 {