diff --git a/src/system/setting_helpers.cpp b/src/system/setting_helpers.cpp index 14eb437de..fb5cb0ff9 100644 --- a/src/system/setting_helpers.cpp +++ b/src/system/setting_helpers.cpp @@ -456,8 +456,23 @@ bool CKeySetupNotifier::changeNotify(const neutrino_locale_t, void *) g_RCInput->repeat_block_generic = xdelay * 1000; int fd = g_RCInput->getFileHandle(); +#ifdef HAVE_COOL_HARDWARE ioctl(fd, IOC_IR_SET_F_DELAY, fdelay); ioctl(fd, IOC_IR_SET_X_DELAY, xdelay); +#else + /* if we have a good input device, we don't need the private ioctl above */ + struct my_repeat { + unsigned int delay; /* in ms */ + unsigned int period; /* in ms */ + }; + struct my_repeat n; + /* increase by 10 ms to trick the repeat checker code in the + * rcinput loop into accepting the key event... */ + n.delay = fdelay + 10; + n.period = xdelay + 10; + if (ioctl(fd, EVIOCSREP, &n)) + perror("CKeySetupNotifier::changeNotify EVIOCSREP"); +#endif return false; }