Add more fix on key translation for configtool.
This commit is contained in:
parent
47628ac9f8
commit
91a4b144c0
|
@ -15,8 +15,8 @@
|
|||
#include <QTextCodec>
|
||||
#include <QWindow>
|
||||
#include <qpa/qplatformcursor.h>
|
||||
#include <qpa/qplatformscreen.h>
|
||||
#include <qpa/qplatformnativeinterface.h>
|
||||
#include <qpa/qplatformscreen.h>
|
||||
#include <qpa/qwindowsysteminterface.h>
|
||||
|
||||
#include <errno.h>
|
||||
|
|
|
@ -51,7 +51,7 @@ void qEventToSym(int key, Qt::KeyboardModifiers mod, const QString &text,
|
|||
result->qtcode != key)
|
||||
result = nullptr;
|
||||
} else {
|
||||
if (text.isEmpty() || text[0].unicode() == 0) {
|
||||
if (text.isEmpty() || !text[0].isPrint()) {
|
||||
result = std::lower_bound(qtCodeToKeyBackup,
|
||||
_ARRAY_END(qtCodeToKeyBackup), key);
|
||||
if (result == _ARRAY_END(qtCodeToKeyBackup) ||
|
||||
|
|
|
@ -30,5 +30,15 @@ int main(int argc, char *argv[]) {
|
|||
|
||||
FCITX_ASSERT(sym == FcitxKey_space) << sym;
|
||||
FCITX_ASSERT(static_cast<fcitx::KeyState>(states) == fcitx::KeyState::Ctrl);
|
||||
|
||||
fcitx::keyQtToSym(Qt::Key_F, Qt::ControlModifier, "", sym, states);
|
||||
|
||||
FCITX_ASSERT(sym == FcitxKey_F) << sym;
|
||||
FCITX_ASSERT(static_cast<fcitx::KeyState>(states) == fcitx::KeyState::Ctrl);
|
||||
|
||||
fcitx::keyQtToSym(Qt::Key_F, Qt::ControlModifier, "\x06", sym, states);
|
||||
|
||||
FCITX_ASSERT(sym == FcitxKey_F) << sym;
|
||||
FCITX_ASSERT(static_cast<fcitx::KeyState>(states) == fcitx::KeyState::Ctrl);
|
||||
return 0;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue