From ec9c01c2d485d09614cfa251ca6600a045113f46 Mon Sep 17 00:00:00 2001 From: bakkeby Date: Sun, 3 Aug 2025 22:27:35 +0200 Subject: [PATCH] quick cancel: allow cancelling by key press in addition to mouse movement ref. #11 --- slock.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/slock.c b/slock.c index fad8afc67393ad4dceebae90409cbbf1c20543a9..5711cfbcdb8e88987561e3ace58cc4371287c53e 100644 --- a/slock.c +++ b/slock.c @@ -261,7 +261,7 @@ readpw(Display *dpy, struct xrandr *rr, struct lock **locks, int nscreens, XNextEvent(dpy, &ev); #endif // AUTO_TIMEOUT_PATCH #if QUICKCANCEL_PATCH - running = !((time(NULL) - locktime < timetocancel) && (ev.type == MotionNotify)); + running = !((time(NULL) - locktime < timetocancel) && (ev.type == MotionNotify || ev.type == KeyPress)); #endif // QUICKCANCEL_PATCH if (ev.type == KeyPress) { #if AUTO_TIMEOUT_PATCH