X-Git-Url: https://git.danieliu.xyz/?a=blobdiff_plain;f=dmenu.c;h=695b25c25f04e9490b1ec683578eaed8762c819e;hb=e7423f8fc69d9b7dc8c04e4ed8bb546938449084;hp=bc69bcf704d90311e35d3ce7f482fe35de16b412;hpb=63c9e30a7638a1e8e845fb32c9284f118b3102ed;p=dmenu.git diff --git a/dmenu.c b/dmenu.c index bc69bcf..695b25c 100644 --- a/dmenu.c +++ b/dmenu.c @@ -353,13 +353,11 @@ 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) { + if(IsKeypadKey(ksym)) + if(ksym == XK_KP_Enter) ksym = XK_Return; - } else if(ksym >= XK_KP_0 && ksym <= XK_KP_9) { + 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)) @@ -709,12 +707,11 @@ main(int argc, char *argv[]) { if(++i < argc) x = atoi(argv[i]); } else if(!strcmp(argv[i], "-y")) { - if(++i < argc) { + if(++i < argc) if(!strcmp(argv[i], "-0")) y = (int)(unsigned int)-1; else y = atoi(argv[i]); - } } else if(!strcmp(argv[i], "-w")) { if(++i < argc) w = atoi(argv[i]);