Code

keyboard: move code to ignore_key()
authorMax Kellermann <max.kellermann@gmail.com>
Mon, 20 Mar 2017 19:00:09 +0000 (20:00 +0100)
committerMax Kellermann <max.kellermann@gmail.com>
Mon, 20 Mar 2017 19:00:09 +0000 (20:00 +0100)
src/keyboard.c

index 5042af2a3648e9e0b1237e54b44de3fda42cb8a4..edf7e61a6c5536fe2fdcfbe0fa37351b695c7b7a 100644 (file)
 
 #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