From: Max Kellermann Date: Mon, 20 Mar 2017 19:00:09 +0000 (+0100) Subject: keyboard: move code to ignore_key() X-Git-Tag: v0.27~33 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=6827c0b2b729b2ba0bd481f7dfc28bd339c05c86;p=ncmpc.git keyboard: move code to ignore_key() --- diff --git a/src/keyboard.c b/src/keyboard.c index 5042af2..edf7e61 100644 --- a/src/keyboard.c +++ b/src/keyboard.c @@ -28,11 +28,17 @@ #include +static bool +ignore_key(int key) +{ + return key == ERR || key == '\0'; +} + gcc_pure static command_t translate_key(int key) { - if (key == ERR || key == '\0') + if (ignore_key(key)) return CMD_NONE; #ifdef HAVE_GETMOUSE