diff options
author | Anselm R. Garbe <arg@suckless.org> | 2007-03-27 16:52:50 +0200 |
---|---|---|
committer | Anselm R. Garbe <arg@suckless.org> | 2007-03-27 16:52:50 +0200 |
commit | 1fa4fa386aa7c03f8fa3bf2ffedd78bfe24fe9d4 (patch) | |
tree | f98cb742a1ad59059b0f457c69aca014dfeabd47 | |
parent | e1515a2fdcf60987d964b0d616bd44ec3980a89b (diff) |
allowing numpad keys as inpyt
-rw-r--r-- | main.c | 7 |
1 files changed, 7 insertions, 0 deletions
@@ -216,6 +216,13 @@ kpress(XKeyEvent * e) { | |||
216 | len = strlen(text); | 216 | len = strlen(text); |
217 | buf[0] = 0; | 217 | buf[0] = 0; |
218 | num = XLookupString(e, buf, sizeof buf, &ksym, 0); | 218 | num = XLookupString(e, buf, sizeof buf, &ksym, 0); |
219 | if(IsKeypadKey(ksym)) { | ||
220 | if(ksym == XK_KP_Enter) { | ||
221 | ksym = XK_Return; | ||
222 | } else if(ksym >= XK_KP_0 && ksym <= XK_KP_9) { | ||
223 | ksym = (ksym - XK_KP_0) + XK_0; | ||
224 | } | ||
225 | } | ||
219 | if(IsFunctionKey(ksym) || IsKeypadKey(ksym) | 226 | if(IsFunctionKey(ksym) || IsKeypadKey(ksym) |
220 | || IsMiscFunctionKey(ksym) || IsPFKey(ksym) | 227 | || IsMiscFunctionKey(ksym) || IsPFKey(ksym) |
221 | || IsPrivateKeypadKey(ksym)) | 228 | || IsPrivateKeypadKey(ksym)) |