Autorepeat question - quick review

Jeremy Huddleston jeremyhu at freedesktop.org
Tue Dec 30 13:46:15 PST 2008


Is this the right way to setup auto-repeating?  I didn't see an  
XkbSetRepeatRate or something similar... so is this what I should be  
doing, or should I be calling something?

(note that this hunk is immediately after my call to  
XkbInitKeyboardDeviceStruct(pDev, ...):

diff --git a/hw/xquartz/quartzKeyboard.c b/hw/xquartz/quartzKeyboard.c
index bc7efdf..2e8ca86 100644
--- a/hw/xquartz/quartzKeyboard.c
+++ b/hw/xquartz/quartzKeyboard.c
@@ -342,7 +342,12 @@ void DarwinKeyboardInit(DeviceIntPtr pDev) {
                                         QuartzBell,  
DarwinChangeKeyboardControl));
      pthread_mutex_unlock(&keyInfo_mutex);

-	SwitchCoreKeyboard(pDev);
+    // Enable autorepeat
+    pDev->key->xkbInfo->desc->ctrls->repeat_delay = 500;
+    pDev->key->xkbInfo->desc->ctrls->repeat_interval = 100;
+    XkbSetRepeatKeys(pDev, -1, AutoRepeatModeOn);
+
+    SwitchCoreKeyboard(pDev);

      DarwinKeyboardSetDeviceKeyMap(&keySyms);
  }




More information about the xorg mailing list