如何/查询什么以获取当前 QtVirtualKeyboard 输入法的值

How to / What to Query to get value of current QtVirtualKeyboard Input Method

谁能告诉我什么属性我可以检查以确定活动输入法(即手写、键盘等)?

基本上,我希望有这样的逻辑:

if (inputMethod === "handwriting") {
    //do this
} else {
    //do that
}

if (handwriting.active) {
    //do this
} else {
    //do that
}

我已经通读了 InputMethod, InputEngine, and InputContext 的所有文档,不幸的是,像 "provides access to an input context" 这样的描述没有帮助。

它告诉我 QML 类型有什么...但没有告诉我它是什么。此外,在三种 QML 类型中的两种的属性中,其他两种 QML 类型是可访问的,这对我来说似乎有点随机和循环,只会增加我的困惑。

可以通过多种方式完成,具体取决于您的键盘实现。我看到的最简单的方法是使用 HandwritingInputPanel's active property or detect a HandwritingModeKey press.