From 1e49f9371f39475be7d2a3a9be2994ce5d27870b Mon Sep 17 00:00:00 2001 From: Gerd Hoffmann Date: Fri, 18 Jan 2019 10:23:41 +0100 Subject: abstract away some kbd details --- fbpdf.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'fbpdf.c') diff --git a/fbpdf.c b/fbpdf.c index 6ceff19..2c2b10f 100644 --- a/fbpdf.c +++ b/fbpdf.c @@ -340,7 +340,7 @@ int main(int argc, char *argv[]) gfx->stride); } - tty_raw(); + kbd_init(); index = 0; newpage = true; @@ -364,9 +364,7 @@ int main(int argc, char *argv[]) continue; } - memset(key, 0, sizeof(key)); - read(0, key, sizeof(key)-1); - keycode = kbd_parse(key, &keymod); + kbd_read(key, sizeof(key), &keycode, &keymod); switch (keycode) { case KEY_ESC: @@ -417,7 +415,7 @@ int main(int argc, char *argv[]) } } - tty_restore(); + kbd_fini(); cleanup_and_exit(0); return 0; } -- cgit