commit ec9c01c2d485d09614cfa251ca6600a045113f46
parent 72023758232e708018d3c7b0b324e61f55cb5c9b
Author: bakkeby <bakkeby@gmail.com>
Date: Sun, 3 Aug 2025 22:27:35 +0200
quick cancel: allow cancelling by key press in addition to mouse movement ref. #11
Diffstat:
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git 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