#include <linux/input.h>
struct input_event ie;
ie.type = EV_REP;
ie.code = REP_DELAY;
ie.value = 1000; /* 1 second initial delay */
if (write(fd, &ie, sizeof(ie)) == -1)
perror("REP_DELAY");
ie.code = REP_PERIOD;
ie.value = 250; /* 4 events per second */
if (write(fd, &ie, sizeof(ie)) == -1)
perror("REP_PERIOD");
Looks pretty trivial, doesn't it? But it took me quite some time to realize that I needed to write a "magic" event into the device to set the properties ;)
No comments:
Post a Comment