Set sane auto-repeat

This commit is contained in:
dschmenk 2013-06-11 19:38:58 -07:00
parent b3d93f076c
commit e85314fa3c

View File

@ -603,6 +603,20 @@ void main(int argc, char **argv)
write(kbdfd, &uidev, sizeof(uidev));
if (ioctl(kbdfd, UI_DEV_CREATE) < 0)
die("error: ioctl DEV_CREATE");
/*
* Set repeat delay values that make sense.
*/
bzero(&evkey, sizeof(evkey));
evkey.type = EV_REP;
evkey.code = REP_DELAY;
evkey.value = 500; /* 0.5 sec delay */
if (write(kbdfd, &evkey, sizeof(evkey)) < 0)
die("error: REP_DELAY");
evkey.type = EV_REP;
evkey.code = REP_PERIOD;
evkey.value = 100; /* 10 reps/sec */
if (write(kbdfd, &evkey, sizeof(evkey)) < 0)
die("error: REP_PERIOD");
/*
* Create mouse input device
*/