Code

keyboard: implement keyboard_unread() without ungetch()
authorMax Kellermann <max.kellermann@gmail.com>
Mon, 20 Mar 2017 11:19:29 +0000 (12:19 +0100)
committerMax Kellermann <max.kellermann@gmail.com>
Mon, 20 Mar 2017 11:19:29 +0000 (12:19 +0100)
src/keyboard.c

index da0b5a20e6fd2dcfc6f95666925746591593b277..d990e3691e7854d011672527062f9d51fc7ede70 100644 (file)
@@ -75,9 +75,7 @@ keyboard_init(void)
 void
 keyboard_unread(int key)
 {
-       ungetch(key);
-
-       command_t cmd = get_keyboard_command();
+       command_t cmd = translate_key(key);
        if (cmd != CMD_NONE)
                do_input_event(cmd);
 }