aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/handlekeys.c
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--handlekeys.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/handlekeys.c b/handlekeys.c
index e605966..44c0748 100644
--- a/handlekeys.c
+++ b/handlekeys.c
@@ -253,6 +253,8 @@ void handle_keys(long extra, int (*handle_event)(long extra, struct keyevent *ev
253 else 253 else
254 { 254 {
255 buffIndex += j; 255 buffIndex += j;
256 buffer[buffIndex] = 0;
257
256 // Send raw keystrokes, mostly for things like showkey. 258 // Send raw keystrokes, mostly for things like showkey.
257 event.type = HK_RAW; 259 event.type = HK_RAW;
258 event.sequence = buffer; 260 event.sequence = buffer;
@@ -261,13 +263,13 @@ void handle_keys(long extra, int (*handle_event)(long extra, struct keyevent *ev
261 263
262 if (sizeof(buffer) < (buffIndex + 1)) // Ran out of buffer. 264 if (sizeof(buffer) < (buffIndex + 1)) // Ran out of buffer.
263 { 265 {
266 buffer[buffIndex] = 0;
264 fprintf(stderr, "Full buffer - %s -> %s\n", buffer, sequence); 267 fprintf(stderr, "Full buffer - %s -> %s\n", buffer, sequence);
265 for (j = 0; buffer[j + 1]; j++) 268 for (j = 0; buffer[j]; j++)
266 fprintf(stderr, "(%x) %c, ", (int) buffer[j], buffer[j]); 269 fprintf(stderr, "(%x) %c, ", (int) buffer[j], buffer[j]);
267 fflush(stderr); 270 fflush(stderr);
268 buffIndex = 0; 271 buffer[0] = buffIndex = 0;
269 } 272 }
270 buffer[buffIndex] = 0;
271 } 273 }
272 } 274 }
273 275