summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: e73ca30)
raw | patch | inline | side by side (parent: e73ca30)
author | Max Kellermann <max.kellermann@gmail.com> | |
Mon, 20 Mar 2017 19:00:09 +0000 (20:00 +0100) | ||
committer | Max Kellermann <max.kellermann@gmail.com> | |
Mon, 20 Mar 2017 19:00:09 +0000 (20:00 +0100) |
src/keyboard.c | patch | blob | history |
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