diff options
-rw-r--r-- | cache/cache.c | 27 |
1 files changed, 20 insertions, 7 deletions
diff --git a/cache/cache.c b/cache/cache.c index ac287b3b..85d33d6d 100644 --- a/cache/cache.c +++ b/cache/cache.c @@ -33,15 +33,28 @@ void parseKeymapFile(struct xkb_keymap *map) if (!ret) continue; - if ((strstr(buf, "keyboard") > 0) && (strstr(buf, "repeat") > 0)) + if (strstr(buf, "keyboard") > 0) { - tmp = strtok(buf, " "); - tmp = strtok(NULL, " "); - if (!tmp) continue; - keycode = atoi(tmp) + 8; + if (strstr(buf, "repeat") > 0) + { + tmp = strtok(buf, " "); + tmp = strtok(NULL, " "); + if (!tmp) continue; + keycode = atoi(tmp) + 8; - res = xkb_keymap_key_set_repeats(map, keycode, 1); - printf("Set key(%d) to enable repeat: %d\n", keycode, res); + res = xkb_keymap_key_set_repeats(map, keycode, 1); + printf("Set key(%d) to enable repeat: %d\n", keycode, res); + } + else + { + tmp = strtok(buf, " "); + tmp = strtok(NULL, " "); + if (!tmp) continue; + keycode = atoi(tmp) + 8; + + res = xkb_keymap_key_set_repeats(map, keycode, 0); + printf("Set key(%d) to disable repeat: %d\n", keycode, res); + } } } |