diff --git a/programs/sxmo_screenlock.c b/programs/sxmo_screenlock.c index 30231de..c38824b 100644 --- a/programs/sxmo_screenlock.c +++ b/programs/sxmo_screenlock.c @@ -6,6 +6,7 @@ #include #include #include +#include #include #include @@ -177,7 +178,7 @@ readinputloop(Display *dpy, int screen) { if (FD_ISSET(xfd, &fdset) && XPending(dpy)) { XNextEvent(dpy, &ev); - if (ev.type == KeyPress) { + if (ev.type == KeyRelease) { XLookupString(&ev.xkey, buf, sizeof(buf), &keysym, 0); if (lastkeysym == keysym) { lastkeyn++; @@ -282,6 +283,7 @@ main(int argc, char **argv) { if (!(dpy = XOpenDisplay(NULL))) die("Cannot open display\n"); + XkbSetDetectableAutoRepeat(dpy, True, NULL); screen = XDefaultScreen(dpy); XSync(dpy, 0); getoldbrightness();