diff options
| author | Malfurious <m@lfurio.us> | 2021-10-03 22:49:39 -0400 |
|---|---|---|
| committer | Matt Hunter <m@lfurio.us> | 2026-01-17 17:10:07 -0500 |
| commit | 813a093e6c3c66b61020a4a855c83a236c4cdd7c (patch) | |
| tree | 5ad0d9cd934551c6e0f20a3e0dbc229aa6292a65 /slock.c | |
| parent | d4d464a866115430418f066e1d66cb701018304e (diff) | |
| download | slock-813a093e6c3c66b61020a4a855c83a236c4cdd7c.tar.gz slock-813a093e6c3c66b61020a4a855c83a236c4cdd7c.zip | |
patch: control-clear
Adds an additional configuration parameter, controlkeyclear. When set to
1, slock will no longer change to the failure color if a control key is
pressed while the buffer is empty. This is useful if, for example, you
wake your monitor up by pressing a control key and don't want to spoil
the detection of failed unlocking attempts.
Diffstat (limited to 'slock.c')
| -rw-r--r-- | slock.c | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -190,8 +190,9 @@ readpw(Display *dpy, struct xrandr *rr, struct lock **locks, int nscreens, caps = !caps; break; default: - if (num && !iscntrl((int)buf[0]) && - (len + num < sizeof(passwd))) { + if (controlkeyclear && iscntrl((int)buf[0])) + continue; + if (num && (len + num < sizeof(passwd))) { memcpy(passwd + len, buf, num); len += num; } |
