mirror of
https://github.com/X11Libre/xf86-input-evdev.git
synced 2026-03-27 03:04:30 +00:00
Fix a bug where we potentially wrote garbage events when LEDs change.
Support setting keyboard repeat rate/period.
This commit is contained in:
@@ -269,8 +269,22 @@ EvdevKbdCtrl(DeviceIntPtr device, KeybdCtrl *ctrl)
|
||||
ev[i].type = EV_LED;
|
||||
ev[i].code = bits[i].code;
|
||||
ev[i].value = (ctrl->leds & bits[i].xbit) > 0;
|
||||
}
|
||||
write(pInfo->fd, ev, sizeof(ev));
|
||||
|
||||
write(pInfo->fd, ev, sizeof ev);
|
||||
if (device->key && device->key->xkbInfo && device->key->xkbInfo->desc
|
||||
&& device->key->xkbInfo->desc->ctrls) {
|
||||
XkbControlsRec *ctrls = device->key->xkbInfo->desc->ctrls;
|
||||
|
||||
ev[0].type = EV_REP;
|
||||
ev[0].code = REP_DELAY;
|
||||
ev[0].value = ctrls->repeat_delay;
|
||||
|
||||
ev[1].type = EV_REP;
|
||||
ev[1].code = REP_PERIOD;
|
||||
ev[1].value = ctrls->repeat_interval;
|
||||
|
||||
write(pInfo->fd, ev, sizeof(ev[0]) * 2);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user