qt从代码设置QWSServer keymap [英] qt setting QWSServer keymap from code
问题描述
我需要嵌入式QWSServer应用程序的键盘图。
I need to a keymap for my embedded QWSServer application.
使用这样的环境变量
QWS_KEYBOARD="TTY:keymap=/german_keyboard.qmap"
export QWS_KEYBOARD
工作,但对我来说不是最佳的。
works, but isn't optimal for me.
我尝试使用
QWSServer* wsServer = QWSServer::instance();
QWSKeyboardHandler * kh = QKbdDriverFactory::create("TTY", "keymap=/german_keymap.qmap");
wsServer->setKeyboardHandler(kh);
如上所述这里。
但是,它不工作。任何想法如何解决?
However, it is not working. Any ideas how to fix it?
推荐答案
它实际上看起来像你不能做到。根据此手册页,您只能设置驱动程序和设备键盘处理程序,但没有其他选项,如键盘映射。
在这个的关键字映射事情只有环境变量的方式也提到了。
It actually looks like you couldn't do it. According to this manual page you can only set the driver and device for a keyboard handler, but no additional options like keymap. In this arcticle about the keymap thing only the environment variable way ist mentioned, too.
正因为如此,答案这里似乎是错误的。
Because of this, the answer here seems to be wrong.
小心:根据此答案< a>,Qt5没有QWS,所有QWS相关的API都已被删除。
Beware: According to this answer, Qt5 doesn't have QWS and all QWS-related APIs have been removed.
这篇关于qt从代码设置QWSServer keymap的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!