Browse Source

allowing numpad keys as inpyt

master
Anselm R. Garbe 17 years ago
parent
commit
1fa4fa386a
1 changed files with 7 additions and 0 deletions
  1. +7
    -0
      main.c

+ 7
- 0
main.c View File

@@ -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))


Loading…
Cancel
Save