blob: accdb31db1033b83912d2b7733ce0912f18f062f (
plain) (
tree)
|
|
#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;
}
|