aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnselm R. Garbe <arg@suckless.org>2007-03-27 16:52:50 +0200
committerAnselm R. Garbe <arg@suckless.org>2007-03-27 16:52:50 +0200
commit1fa4fa386aa7c03f8fa3bf2ffedd78bfe24fe9d4 (patch)
treef98cb742a1ad59059b0f457c69aca014dfeabd47
parente1515a2fdcf60987d964b0d616bd44ec3980a89b (diff)
downloaddmenu-1fa4fa386aa7c03f8fa3bf2ffedd78bfe24fe9d4.tar.gz
dmenu-1fa4fa386aa7c03f8fa3bf2ffedd78bfe24fe9d4.tar.bz2
dmenu-1fa4fa386aa7c03f8fa3bf2ffedd78bfe24fe9d4.zip
allowing numpad keys as inpyt
-rw-r--r--main.c7
1 files changed, 7 insertions, 0 deletions
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))