diff --git a/docs/spmenu.conf b/docs/spmenu.conf index 90d044a..e1a48ef 100644 --- a/docs/spmenu.conf +++ b/docs/spmenu.conf @@ -422,21 +422,21 @@ spmenu = { // Shift+=: Increase image size by 100 { mode = 0; modifier = "Shift"; - key = "="; + key = "+"; // Note that + is used instead of = because Shift is held down. function = "setimgsize"; argument = "+100"; }, // Shift+-: Decrease image size by 100 { mode = 0; modifier = "Shift"; - key = "-"; + key = "_"; // Note that _ is used instead of - because Shift is held down. function = "setimgsize"; argument = "-100"; }, // Shift+0: Set image size to the default { mode = 0; modifier = "Shift"; - key = "0"; + key = ")"; // Note that ) is used instead of 0 because Shift is held down. function = "defaultimg"; argument = "0"; }, @@ -485,14 +485,14 @@ spmenu = { // Shift+1: Decrease image gaps by 100 { mode = 0; modifier = "Shift"; - key = "1"; + key = "!"; // Note that ! is used instead of 1 because Shift is held down. function = "setimggaps"; argument = "-100"; }, // Shift+2: Increase image gaps by 100 { mode = 0; modifier = "Shift"; - key = "2"; + key = "@"; // Note that @ is used instead of 2 because Shift is held down. function = "setimggaps"; argument = "+100"; }, diff --git a/libs/x11/key.c b/libs/x11/key.c index ca55272..efc9dd2 100644 --- a/libs/x11/key.c +++ b/libs/x11/key.c @@ -18,7 +18,8 @@ void keypress_x11(XEvent *e) { updatenumlockmask(); { unsigned int i; - KeySym keysym; + KeySym keysym = NoSymbol; + KeySym keysym_case = NoSymbol; XKeyEvent *ev; char buf[64]; KeySym ksym = NoSymbol; @@ -28,7 +29,8 @@ void keypress_x11(XEvent *e) { ev = &e->xkey; len = XmbLookupString(xic, ev, buf, sizeof buf, &ksym, &status); - keysym = XkbKeycodeToKeysym(dpy, (KeyCode)ev->keycode, 0, 0); + // keysym = XkbKeycodeToKeysym(dpy, (KeyCode)ev->keycode, 0, 0); + XConvertCase(ksym, &keysym, &keysym_case); // this makes sure we always have a way to exit if we unbind our quit key if (keysym == hkeys[0].keysym && CLEANMASK(hkeys[0].mod) == CLEANMASK(ev->state) && hkeys[0].func) hkeys[0].func(&(hkeys[0].arg));