Fix the XkbSetRepeatKeys trap
Submitted by Jeremy Huddleston Sequoia
Assigned to Xorg Project Team
Description
XkbSetRepeatKeys works for setting global key repeat but it doesn't work for setting repeat rate for individual keys.
We're directly setting the structs now:
/* Turn off key-repeat for modifier keys, on for others */
/* First set them all on */
for(i=0; i < XkbPerKeyBitArraySize; i++)
ctrl->per_key_repeat[i] = -1;
/* Now turn off the modifiers */
for(i=0; i < 32; i++) {
unsigned char keycode;
keycode = keyInfo.modifierKeycodes[i][0];
if(keycode)
ClearBit(ctrl->per_key_repeat, keycode + MIN_KEYCODE);
keycode = keyInfo.modifierKeycodes[i][1];
if(keycode)
ClearBit(ctrl->per_key_repeat, keycode + MIN_KEYCODE);
}
And that didn't quite work... some random bits would not get set the way I wanted, but then we threw this bit of kludge in:
/* Hurray for data duplication */
if (pDev->kbdfeed)
memcpy(pDev->kbdfeed->ctrl.autoRepeats, ctrl->per_key_repeat, XkbPerKeyBitArraySize);