mirror of
https://github.com/Armored-Dragon/overte.git
synced 2025-03-11 16:13:16 +01:00
add API for unfocusing input fields in HTML, unfocus WebEngine-based QML items on lowering keyboard
This commit is contained in:
parent
fb14e4dc4d
commit
eb4214fb4c
4 changed files with 21 additions and 0 deletions
|
@ -27,6 +27,12 @@ Item {
|
||||||
id: hifi
|
id: hifi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function unfocus() {
|
||||||
|
webViewCore.runJavaScript("if (document.activeElement) document.activeElement.blur();", function(result) {
|
||||||
|
console.log('unfocus completed: ', result);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
function onLoadingChanged(loadRequest) {
|
function onLoadingChanged(loadRequest) {
|
||||||
if (WebEngineView.LoadStartedStatus === loadRequest.status) {
|
if (WebEngineView.LoadStartedStatus === loadRequest.status) {
|
||||||
|
|
||||||
|
|
|
@ -10,6 +10,11 @@ Item {
|
||||||
property alias urlTag: webroot.urlTag
|
property alias urlTag: webroot.urlTag
|
||||||
property bool keyboardEnabled: true // FIXME - Keyboard HMD only: Default to false
|
property bool keyboardEnabled: true // FIXME - Keyboard HMD only: Default to false
|
||||||
property bool keyboardRaised: false
|
property bool keyboardRaised: false
|
||||||
|
onKeyboardRaisedChanged: {
|
||||||
|
if(!keyboardRaised) {
|
||||||
|
webroot.unfocus();
|
||||||
|
}
|
||||||
|
}
|
||||||
property bool punctuationMode: false
|
property bool punctuationMode: false
|
||||||
|
|
||||||
// FIXME - Keyboard HMD only: Make Interface either set keyboardRaised property directly in OffscreenQmlSurface
|
// FIXME - Keyboard HMD only: Make Interface either set keyboardRaised property directly in OffscreenQmlSurface
|
||||||
|
|
|
@ -15,6 +15,11 @@ Item {
|
||||||
property string scriptURL
|
property string scriptURL
|
||||||
property bool keyboardEnabled: false
|
property bool keyboardEnabled: false
|
||||||
property bool keyboardRaised: false
|
property bool keyboardRaised: false
|
||||||
|
onKeyboardRaisedChanged: {
|
||||||
|
if(!keyboardRaised) {
|
||||||
|
webroot.unfocus();
|
||||||
|
}
|
||||||
|
}
|
||||||
property bool punctuationMode: false
|
property bool punctuationMode: false
|
||||||
property bool passwordField: false
|
property bool passwordField: false
|
||||||
property bool isDesktop: false
|
property bool isDesktop: false
|
||||||
|
|
|
@ -12,6 +12,11 @@ Item {
|
||||||
property alias urlTag: webroot.urlTag
|
property alias urlTag: webroot.urlTag
|
||||||
property bool keyboardEnabled: true // FIXME - Keyboard HMD only: Default to false
|
property bool keyboardEnabled: true // FIXME - Keyboard HMD only: Default to false
|
||||||
property bool keyboardRaised: false
|
property bool keyboardRaised: false
|
||||||
|
onKeyboardRaisedChanged: {
|
||||||
|
if(!keyboardRaised) {
|
||||||
|
webroot.unfocus();
|
||||||
|
}
|
||||||
|
}
|
||||||
property bool punctuationMode: false
|
property bool punctuationMode: false
|
||||||
property bool passwordField: false
|
property bool passwordField: false
|
||||||
property alias flickable: webroot.interactive
|
property alias flickable: webroot.interactive
|
||||||
|
|
Loading…
Reference in a new issue