From 6827c0b2b729b2ba0bd481f7dfc28bd339c05c86 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Mon, 20 Mar 2017 20:00:09 +0100 Subject: [PATCH] keyboard: move code to ignore_key() --- src/keyboard.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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 -- 2.30.2