neutrino: fix input device repeat setting for pre 2.6.17 kernels

This commit is contained in:
Stefan Seyfried
2012-03-25 20:08:38 +02:00
parent 63178c1e2a
commit 146c46da8e
2 changed files with 12 additions and 10 deletions

View File

@@ -155,7 +155,7 @@ void CRCInput::open()
for (int i = 0; i < NUMBER_OF_EVENT_DEVICES; i++)
{
if ((fd_rc[i] = ::open(RC_EVENT_DEVICE[i], O_RDONLY)) == -1)
if ((fd_rc[i] = ::open(RC_EVENT_DEVICE[i], O_RDWR)) == -1)
perror(RC_EVENT_DEVICE[i]);
else
{

View File

@@ -461,17 +461,19 @@ bool CKeySetupNotifier::changeNotify(const neutrino_locale_t, void *)
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;
struct input_event ie;
ie.type = EV_REP;
/* 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");
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
return false;
}