mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-08-28 16:01:20 +02:00
neutrino: fix input device repeat setting for pre 2.6.17 kernels
This commit is contained in:
@@ -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
|
||||
{
|
||||
|
@@ -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;
|
||||
}
|
||||
|
Reference in New Issue
Block a user