summaryrefslogtreecommitdiffstats
path: root/prog/miška
diff options
context:
space:
mode:
authorAnton Luka Šijanec <anton@sijanec.eu>2023-08-06 15:56:08 +0200
committerAnton Luka Šijanec <anton@sijanec.eu>2023-08-06 15:56:08 +0200
commit4b65846d2e369636e1c947c98c31507d4c08af10 (patch)
treeba8d82c0c1ca0e54943b86ca68f665cfd66a078f /prog/miška
parentraw6 (diff)
downloadr-4b65846d2e369636e1c947c98c31507d4c08af10.tar
r-4b65846d2e369636e1c947c98c31507d4c08af10.tar.gz
r-4b65846d2e369636e1c947c98c31507d4c08af10.tar.bz2
r-4b65846d2e369636e1c947c98c31507d4c08af10.tar.lz
r-4b65846d2e369636e1c947c98c31507d4c08af10.tar.xz
r-4b65846d2e369636e1c947c98c31507d4c08af10.tar.zst
r-4b65846d2e369636e1c947c98c31507d4c08af10.zip
Diffstat (limited to 'prog/miška')
-rw-r--r--prog/miška/d.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/prog/miška/d.c b/prog/miška/d.c
new file mode 100644
index 0000000..accdb31
--- /dev/null
+++ b/prog/miška/d.c
@@ -0,0 +1,17 @@
+#include <stdio.h>
+#include <stdlib.h>
+int main (int argc, char ** argv) {
+ if (argc != 3) {
+ fprintf(stderr, "%s /dev/input/event3 'shell command' \n", argv[0]);
+ return 1;
+ }
+ FILE * btn = fopen(argv[1], "rb");
+ char buf[512];
+ while (1) {
+ fread(buf, 1, 16*6, btn);
+ int ret = system(argv[2]);
+ if (ret)
+ return ret;
+ }
+ return 0;
+}