[prev in list] [next in list] [prev in thread] [next in thread] 

List:       freedesktop-xorg
Subject:    Autorepeat question - quick review
From:       Jeremy Huddleston <jeremyhu () freedesktop ! org>
Date:       2008-12-30 21:46:15
Message-ID: E72DF5AE-C642-4B69-BDA5-294114B6F844 () freedesktop ! org
[Download RAW message or body]

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);
  }

_______________________________________________
xorg mailing list
xorg@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/xorg
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic