diff options
-rw-r--r-- | config.def.h | 3 | ||||
-rw-r--r-- | slock.c | 5 |
2 files changed, 6 insertions, 2 deletions
diff --git a/config.def.h b/config.def.h index 83e4887..3639e91 100644 --- a/config.def.h +++ b/config.def.h @@ -11,3 +11,6 @@ static const char *colorname[NUMCOLS] = { /* treat a cleared input like a wrong password (color) */ static const int failonclear = 1; + +/* allow control key to trigger fail on clear */ +static const int controlkeyclear = 1; @@ -189,8 +189,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; } |