diff options
Diffstat (limited to 'intcp/resc/intcp/main.c')
-rw-r--r-- | intcp/resc/intcp/main.c | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/intcp/resc/intcp/main.c b/intcp/resc/intcp/main.c new file mode 100644 index 0000000..383ef5b --- /dev/null +++ b/intcp/resc/intcp/main.c @@ -0,0 +1,27 @@ +#include <stdio.h> +#include <stdlib.h> +#include <linux/input.h> + +int main(void) { + setbuf(stdin, NULL); setbuf(stdout, NULL); + + struct input_event event; + while (fread(&event, sizeof(event), 1, stdin)) { + if (event.type == EV_KEY) { + switch (event.code) { + case KEY_CAPSLOCK: + event.code = KEY_LEFTCTRL; + break; + case KEY_LEFTALT: + event.code = KEY_LEFTMETA; + break; + case KEY_102ND: + event.code = KEY_LEFTALT; + break; + } + } + + fwrite(&event, sizeof(event), 1, stdout); + } +} + |