From: Max Kellermann Date: Mon, 20 Mar 2017 11:18:48 +0000 (+0100) Subject: keyboard: move code to translate_key() X-Git-Tag: v0.26~11 X-Git-Url: https://git.tokkee.org/?p=ncmpc.git;a=commitdiff_plain;h=9eedd15314515b6d9f51aa64926c14d8bda3a99a keyboard: move code to translate_key() --- 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,