Question

I have a custom Motif Widget and I'd like to tie its behavior to the Keyboard Repeat settings. How do I programmatically get the current KDE Control Center Keyboard Repeat settings of Delay and Rate? What API exists to query and set these values?

Also, how can I register to find out when the user changes these values?

Was it helpful?

Solution

The XKB library functions XkbGetAutoRepeatRate and XkbSetAutoRepeatRate can be used to access the X server repeat delay and rate settings. The functions are documented on their own man pages. There is also XAutoRepeatOn and XAutoRepeatOff in the basic X library.

Note that the rate and delay settings are provided by the XKB extension and are not available in the raw X protocol, but nowadays you can probably assume that the XKB extension is always available.

You will need KDE toolkit functions if you want to save the settings for future sessions, since it is not possible at the raw X level. Unfortunately I don't know anything about them.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top