From 850a8335d5c35cc81ba576cd4636460ea1684223 Mon Sep 17 00:00:00 2001 From: Jari Vetoniemi Date: Sun, 13 Apr 2014 04:16:23 +0300 Subject: [PATCH] Flush input buffer after showing menu first time. --- lib/draw/curses.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/draw/curses.c b/lib/draw/curses.c index 6ebfb45..9a123df 100644 --- a/lib/draw/curses.c +++ b/lib/draw/curses.c @@ -79,6 +79,7 @@ static struct curses { int (*getmaxy)(WINDOW *win); int (*keypad)(WINDOW *win, bool bf); int (*curs_set)(int visibility); + int (*flushinp)(void); int (*noecho)(void); int (*raw)(void); int *ESCDELAY; @@ -181,6 +182,7 @@ static void _bmDrawCursesRender(const bmMenu *menu) return; *curses.ESCDELAY = 25; + curses.flushinp(); curses.keypad(curses.stdscr, true); curses.curs_set(1); curses.noecho(); @@ -409,6 +411,8 @@ int _bmDrawCursesInit(struct _bmRenderApi *api) goto function_pointer_exception; if (!bmLoadFunction(curs_set)) goto function_pointer_exception; + if (!bmLoadFunction(flushinp)) + goto function_pointer_exception; if (!bmLoadFunction(noecho)) goto function_pointer_exception; if (!bmLoadFunction(raw))