diff options
author | 2016-03-24 14:51:02 -0400 | |
---|---|---|
committer | 2016-03-24 14:51:02 -0400 | |
commit | f590acc84c55c1b3d13cfd8b21a4544ee41eaaf0 (patch) | |
tree | b06553c361d7feca2f4ac036327d148aa8e15dbf /swaylock/main.c | |
parent | Update README (diff) | |
parent | swaylock: Interpret XKB_KEY_BackSpace as a deletion instead of a normal key. (diff) | |
download | sway-f590acc84c55c1b3d13cfd8b21a4544ee41eaaf0.tar.gz sway-f590acc84c55c1b3d13cfd8b21a4544ee41eaaf0.tar.zst sway-f590acc84c55c1b3d13cfd8b21a4544ee41eaaf0.zip |
Merge pull request #536 from jcaesar/master
swaylock: Interpret XKB_KEY_BackSpace as a deletion instead of a normal key.
Diffstat (limited to 'swaylock/main.c')
-rw-r--r-- | swaylock/main.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/swaylock/main.c b/swaylock/main.c index 3f0fc867..feb64975 100644 --- a/swaylock/main.c +++ b/swaylock/main.c | |||
@@ -108,6 +108,14 @@ void notify_key(enum wl_keyboard_key_state state, xkb_keysym_t sym, uint32_t cod | |||
108 | password = malloc(password_size); | 108 | password = malloc(password_size); |
109 | password[0] = '\0'; | 109 | password[0] = '\0'; |
110 | break; | 110 | break; |
111 | case XKB_KEY_BackSpace: | ||
112 | { | ||
113 | int i = strlen(password); | ||
114 | if (i > 0) { | ||
115 | password[i - 1] = '\0'; | ||
116 | } | ||
117 | break; | ||
118 | } | ||
111 | default: | 119 | default: |
112 | { | 120 | { |
113 | int i = strlen(password); | 121 | int i = strlen(password); |