keybind_setup: use rcinput->setKeyRepeatDelay()

This commit is contained in:
Stefan Seyfried
2017-02-20 20:25:57 +01:00
parent 57fa882b81
commit f308ca649a

View File

@@ -573,28 +573,7 @@ bool CKeybindSetup::changeNotify(const neutrino_locale_t OptionName, void * /* d
g_RCInput->repeat_block = fdelay * 1000;
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 input_event ie;
memset(&ie, 0, sizeof(ie));
ie.type = EV_REP;
/* increase by 10 ms to trick the repeat checker code in the
* rcinput loop into accepting the key event... */
ie.value = fdelay + 10;
ie.code = REP_DELAY;
if (write(fd, &ie, sizeof(ie)) == -1)
perror("CKeySetupNotifier::changeNotify REP_DELAY");
ie.value = xdelay + 10;
ie.code = REP_PERIOD;
if (write(fd, &ie, sizeof(ie)) == -1)
perror("CKeySetupNotifier::changeNotify REP_PERIOD");
#endif
g_RCInput->setKeyRepeatDelay(fdelay, xdelay);
}
return false;
}