From: Anselm R. Garbe Date: Tue, 27 Mar 2007 14:52:50 +0000 (+0200) Subject: allowing numpad keys as inpyt X-Git-Url: https://git.danieliu.xyz/?a=commitdiff_plain;h=1fa4fa386aa7c03f8fa3bf2ffedd78bfe24fe9d4;p=dmenu.git allowing numpad keys as inpyt --- diff --git a/main.c b/main.c index fa03ec8..9fab328 100644 --- a/main.c +++ b/main.c @@ -216,6 +216,13 @@ kpress(XKeyEvent * e) { len = strlen(text); buf[0] = 0; num = XLookupString(e, buf, sizeof buf, &ksym, 0); + if(IsKeypadKey(ksym)) { + if(ksym == XK_KP_Enter) { + ksym = XK_Return; + } else if(ksym >= XK_KP_0 && ksym <= XK_KP_9) { + ksym = (ksym - XK_KP_0) + XK_0; + } + } if(IsFunctionKey(ksym) || IsKeypadKey(ksym) || IsMiscFunctionKey(ksym) || IsPFKey(ksym) || IsPrivateKeypadKey(ksym))