我在网络上花了相当多的时间来研究检测触摸设备的各种方法,但这个令人惊讶的复杂问题似乎并没有一个明确的答案。基于,我决定采用以下方法。
// Run immediately and assign a global variable (touch_enabled) so it is accessible anywhere.
// First try to detect (not entirely reliable)
window.touch_enabled = !!('ontouchstart' in window) || !!('onmsgesturechange
有人能告诉我,我可以检查哪些属性来确定主动输入法(即手写、键盘等)?
基本上,我希望有一些逻辑,比如:
if (inputMethod === "handwriting") {
//do this
} else {
//do that
}
或
if (handwriting.active) {
//do this
} else {
//do that
}
我已经阅读了、和的所有文档,不幸的是,“提供对输入上下文的访问”这样的描述是没有帮助的。
它告诉我QML类型有什么..。但它的不是。此外,在这三种QML类型中的两种属性中,其他两种QML类型是可