From e403d15732e62fc9f1940ef14dc3b46bb11f5201 Mon Sep 17 00:00:00 2001 From: Kartik Agaram Date: Wed, 16 Sep 2020 18:54:12 -0700 Subject: 6794 - cleaner interface for keyboard So far I've been assuming that read-key only works for ascii, and that I'd need to get more sophisticated both for multi-byte utf-8 and multi-byte terminal escape codes like arrow keys. Rather to my surprise, both work fine. We just need to adjust the types to reflect this fact. --- prototypes/browse/28/main.mu | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'prototypes/browse/28/main.mu') diff --git a/prototypes/browse/28/main.mu b/prototypes/browse/28/main.mu index 96944d40..c9e78b2c 100644 --- a/prototypes/browse/28/main.mu +++ b/prototypes/browse/28/main.mu @@ -14,7 +14,7 @@ fn main args: (addr array addr array byte) -> exit-status/ebx: int { normal-text { render fs, screen-position-state - var key/eax: byte <- read-key + var key/eax: grapheme <- read-key-from-real-keyboard compare key, 0x71 # 'q' loop-if-!= } -- cgit 1.4.1-2-gfad0