如何以编程方式获取 KDE 中的键盘重复设置?
我有一个自定义主题小部件,我想将其行为与键盘重复设置联系起来。 如何以编程方式获取当前 KDE 控制中心 Keyboard Repeat
的 Delay
和 Rate
设置?有哪些 API 可以查询和设置这些值?
另外,我如何注册以了解用户何时更改这些值?
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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
XKB 库函数
XkbGetAutoRepeatRate
和XkbSetAutoRepeatRate
可用于访问 X 服务器重复延迟和速率设置。这些函数记录在它们自己的手册页上。基本X库中还有XAutoRepeatOn
和XAutoRepeatOff
。请注意,速率和延迟设置由 XKB 扩展提供,在原始 X 协议中不可用,但现在您可以假设 XKB 扩展始终可用。
如果您想保存未来会话的设置,您将需要 KDE 工具包功能,因为这在原始 X 级别是不可能的。不幸的是我对他们一无所知。
The XKB library functions
XkbGetAutoRepeatRate
andXkbSetAutoRepeatRate
can be used to access the X server repeat delay and rate settings. The functions are documented on their own man pages. There is alsoXAutoRepeatOn
andXAutoRepeatOff
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.