Handle strings and better utf8 in mousepad plugin
This commit is contained in:
parent
6a7edf5f44
commit
9ca9833e9c
1 changed files with 5 additions and 2 deletions
|
@ -208,8 +208,11 @@ bool MousepadPlugin::handlePackageX11(const NetworkPackage &np)
|
|||
}
|
||||
|
||||
//We use fakekey here instead of XTest (above) because it can handle utf characters instead of keycodes.
|
||||
fakekey_press(m_fakekey, (const unsigned char*)key.toUtf8().constData(), -1, 0);
|
||||
fakekey_release(m_fakekey);
|
||||
for (int i=0;i<key.length();i++) {
|
||||
QByteArray utf8 = QString(key.at(i)).toUtf8();
|
||||
fakekey_press(m_fakekey, (const uchar*)utf8.constData(), utf8.size(), 0);
|
||||
fakekey_release(m_fakekey);
|
||||
}
|
||||
}
|
||||
|
||||
if (ctrl) XTestFakeKeyEvent (display, XKeysymToKeycode(display, XK_Control_L), False, 0);
|
||||
|
|
Loading…
Reference in a new issue