summaryrefslogtreecommitdiff
path: root/intcp-mapper.nix
diff options
context:
space:
mode:
Diffstat (limited to 'intcp-mapper.nix')
-rw-r--r--intcp-mapper.nix6
1 files changed, 4 insertions, 2 deletions
diff --git a/intcp-mapper.nix b/intcp-mapper.nix
index 5863f85..95f0a6a 100644
--- a/intcp-mapper.nix
+++ b/intcp-mapper.nix
@@ -20,11 +20,13 @@ int main(void) {
*/
if (event.type == EV_KEY) {
+ switch (event.code) {
${ lib.concatStrings (map (m: ''
- if (event.code == ${m.from}) {
+ case ${m.from}:
event.code = ${m.to};
- }
+ break;
'') mappings) }
+ }
}
fwrite(&event, sizeof(event), 1, stdout);