xserver: Branch 'xorg-server-1.4-apple'

Jeremy Huddleston jeremyhu at kemper.freedesktop.org
Wed Dec 31 11:18:32 PST 2008


 hw/xquartz/quartzKeyboard.c |   27 ++++++++++++++++++++++++---
 1 file changed, 24 insertions(+), 3 deletions(-)

New commits:
commit 4303c9be39a86f5a21de108f72b90a989435905e
Author: Jeremy Huddleston <jeremyhu at freedesktop.org>
Date:   Wed Dec 31 11:17:38 2008 -0800

    XQuartz: Honor system key repeat rate

diff --git a/hw/xquartz/quartzKeyboard.c b/hw/xquartz/quartzKeyboard.c
index bc7efdf..1f552e0 100644
--- a/hw/xquartz/quartzKeyboard.c
+++ b/hw/xquartz/quartzKeyboard.c
@@ -323,7 +323,9 @@ static void DarwinKeyboardSetDeviceKeyMap(KeySymsRec *keySyms) {
  */
 void DarwinKeyboardInit(DeviceIntPtr pDev) {
     KeySymsRec keySyms;
-	XkbComponentNamesRec names;
+    XkbComponentNamesRec names;
+    CFIndex value;
+    BOOL ok;
 
     // Open a shared connection to the HID System.
     // Note that the Event Status Driver is really just a wrapper
@@ -332,7 +334,7 @@ void DarwinKeyboardInit(DeviceIntPtr pDev) {
 
     DarwinLoadKeyboardMapping(&keySyms);
 
-	bzero(&names, sizeof(names));
+    bzero(&names, sizeof(names));
 
     /* We need to really have rules... or something... */
     //XkbSetRulesDflts("base", "pc105", "us", NULL, NULL);
@@ -342,7 +344,26 @@ void DarwinKeyboardInit(DeviceIntPtr pDev) {
                                        QuartzBell, DarwinChangeKeyboardControl));
     pthread_mutex_unlock(&keyInfo_mutex);
 
-	SwitchCoreKeyboard(pDev);   
+    /* Get our key repeat settings from GlobalPreferences */
+    (void)CFPreferencesAppSynchronize(CFSTR(".GlobalPreferences"));
+    value = CFPreferencesGetAppIntegerValue(CFSTR("InitialKeyRepeat"), CFSTR(".GlobalPreferences"), &ok);
+    if(!ok)
+        value = 35;
+
+    if(value == 300000) { // off
+        XkbSetRepeatKeys(pDev, -1, AutoRepeatModeOff);
+    } else {
+        pDev->key->xkbInfo->desc->ctrls->repeat_delay = value * 15;
+
+        value = CFPreferencesGetAppIntegerValue(CFSTR("KeyRepeat"), CFSTR(".GlobalPreferences"), &ok);
+        if(!ok)
+            value = 6;
+        pDev->key->xkbInfo->desc->ctrls->repeat_interval = value * 15;
+
+        XkbSetRepeatKeys(pDev, -1, AutoRepeatModeOn);
+    }
+
+    SwitchCoreKeyboard(pDev);   
 
     DarwinKeyboardSetDeviceKeyMap(&keySyms);
 }


More information about the xorg-commit mailing list