Autorepeat question - quick review

Jon TURNEY jon.turney at dronecode.org.uk
Tue Jan 6 06:34:39 PST 2009


Jeremy Huddleston wrote:
> 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?

Yes, I'd like to know as well, as Cygwin/X does essentially the same thing.

Recently I had a look for an interface function for setting this, but I didn't 
find anything...

> (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