#include #include #include #include #include #ifndef EVIOCSREP #define EVIOCSREP _IOW('E', 0x03, int[2]) #endif /* compile with gcc -o setspeed setspeed.c */ int main(int argc, char** argv) { int retval = 0; int fd = 0; int rep[2]; rep[1] = 2500; // delay rep[1] = 1000; // repeat rate if ((fd = open( "/dev/input/event2", O_RDWR )) < 0) { printf("unable to access /dev/input/event2, exiting..\n"); exit(1); } if (ioctl(fd, EVIOCSREP, rep)) { perror("unable to set delay and repeat rate for input devices"); exit(1); } close(fd); }