From 9eedd15314515b6d9f51aa64926c14d8bda3a99a Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Mon, 20 Mar 2017 12:18:48 +0100 Subject: [PATCH] keyboard: move code to translate_key() --- src/keyboard.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/keyboard.c b/src/keyboard.c index c5d8c78..da0b5a2 100644 --- a/src/keyboard.c +++ b/src/keyboard.c @@ -27,10 +27,10 @@ #include +gcc_pure static command_t -get_keyboard_command(void) +translate_key(int key) { - int key = wgetch(stdscr); if (key == ERR || key == '\0') return CMD_NONE; @@ -42,6 +42,12 @@ get_keyboard_command(void) return get_key_command(key); } +static command_t +get_keyboard_command(void) +{ + return translate_key(wgetch(stdscr)); +} + static gboolean keyboard_event(gcc_unused GIOChannel *source, gcc_unused GIOCondition condition, -- 2.30.2