From: Jonathan Neuschäfer Date: Sat, 27 Aug 2011 01:16:49 +0000 (+0200) Subject: command: add macro KEY_CTL() X-Git-Tag: release-0.20~95^2~3 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=cbcee2935dd77ffd0403ec20ae5039054a937006;p=ncmpc.git command: add macro KEY_CTL() I copied it from tig[1], which is licensed under the GPLv2+, so we may use the code. [1] http://jonas.nitro.dk/tig/ --- diff --git a/src/command.c b/src/command.c index 0bb45bf..9ce7b0e 100644 --- a/src/command.c +++ b/src/command.c @@ -40,6 +40,8 @@ #define DK(x) #endif +#define KEY_CTL(x) ((x) & 0x1f) /* KEY_CTL(A) == ^A == \1 */ + #define BS KEY_BACKSPACE #define DEL KEY_DC #define UP KEY_UP