X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=src%2Fkeyboard.c;h=edf7e61a6c5536fe2fdcfbe0fa37351b695c7b7a;hb=6827c0b2b729b2ba0bd481f7dfc28bd339c05c86;hp=5042af2a3648e9e0b1237e54b44de3fda42cb8a4;hpb=e79707f956f639af800abe2180f15d3ac3107d58;p=ncmpc.git 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