我试试:
if(lang_toggle==0)
{
server->closeKeyboard();
currentKeyboardHandler =
QKbdDriverFactory::create("TTY", "keymap=/root/ar.qmap");
server->setKeyboardHandler(currentKeyboardHandler);
lang_toggle = 1 ;
}
else if(lang_toggle==1)
{
server->closeKeyboard();
currentKeyboardHandler =
QKbdDriverFactory::create("TTY", "keymap=/root/en.qmap");
server->setKeyboardHandler(currentKeyboardHandler);
lang_toggle = 0 ;
}
如上所述here
它对我有用,但经过一些toggel制作分段错误