diff --git a/src/keyboard.c b/src/keyboard.c
index 80a1eeeae16f41e199fa11dab8cb73ba8216ecd9..c5d8c7814199781863188c7e892acfe3bca77ae6 100644 (file)
--- a/src/keyboard.c
+++ b/src/keyboard.c
#include <unistd.h>
-command_t
+static command_t
get_keyboard_command(void)
{
int key = wgetch(stdscr);
g_io_add_watch(channel, G_IO_IN, keyboard_event, NULL);
g_io_channel_unref(channel);
}
+
+void
+keyboard_unread(int key)
+{
+ ungetch(key);
+
+ command_t cmd = get_keyboard_command();
+ if (cmd != CMD_NONE)
+ do_input_event(cmd);
+}