diff --git a/src/keyboard.c b/src/keyboard.c
index 5042af2a3648e9e0b1237e54b44de3fda42cb8a4..edf7e61a6c5536fe2fdcfbe0fa37351b695c7b7a 100644 (file)
--- a/src/keyboard.c
+++ b/src/keyboard.c
#include <unistd.h>
+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