mirror of
https://github.com/lubosz/overte.git
synced 2025-08-07 19:01:09 +02:00
Merge pull request #11912 from ElderOrb/FB9461
9461 Keyboard for create appear then disappears immediately (HMD)
This commit is contained in:
commit
ec1c4c37fa
2 changed files with 17 additions and 11 deletions
|
@ -12,9 +12,9 @@
|
||||||
var MAX_WARNINGS = 3;
|
var MAX_WARNINGS = 3;
|
||||||
var numWarnings = 0;
|
var numWarnings = 0;
|
||||||
var isWindowFocused = true;
|
var isWindowFocused = true;
|
||||||
var isKeyboardRaised = false;
|
window.isKeyboardRaised = false;
|
||||||
var isNumericKeyboard = false;
|
window.isNumericKeyboard = false;
|
||||||
var isPasswordField = false;
|
window.isPasswordField = false;
|
||||||
|
|
||||||
function shouldSetPasswordField() {
|
function shouldSetPasswordField() {
|
||||||
var nodeType = document.activeElement.type;
|
var nodeType = document.activeElement.type;
|
||||||
|
@ -62,7 +62,7 @@
|
||||||
var passwordField = shouldSetPasswordField();
|
var passwordField = shouldSetPasswordField();
|
||||||
|
|
||||||
if (isWindowFocused &&
|
if (isWindowFocused &&
|
||||||
(keyboardRaised !== isKeyboardRaised || numericKeyboard !== isNumericKeyboard || passwordField !== isPasswordField)) {
|
(keyboardRaised !== window.isKeyboardRaised || numericKeyboard !== window.isNumericKeyboard || passwordField !== window.isPasswordField)) {
|
||||||
|
|
||||||
if (typeof EventBridge !== "undefined" && EventBridge !== null) {
|
if (typeof EventBridge !== "undefined" && EventBridge !== null) {
|
||||||
EventBridge.emitWebEvent(
|
EventBridge.emitWebEvent(
|
||||||
|
@ -75,20 +75,20 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!isKeyboardRaised) {
|
if (!window.isKeyboardRaised) {
|
||||||
scheduleBringToView(250); // Allow time for keyboard to be raised in QML.
|
scheduleBringToView(250); // Allow time for keyboard to be raised in QML.
|
||||||
// 2DO: should it be rather done from 'client area height changed' event?
|
// 2DO: should it be rather done from 'client area height changed' event?
|
||||||
}
|
}
|
||||||
|
|
||||||
isKeyboardRaised = keyboardRaised;
|
window.isKeyboardRaised = keyboardRaised;
|
||||||
isNumericKeyboard = numericKeyboard;
|
window.isNumericKeyboard = numericKeyboard;
|
||||||
isPasswordField = passwordField;
|
window.isPasswordField = passwordField;
|
||||||
}
|
}
|
||||||
}, POLL_FREQUENCY);
|
}, POLL_FREQUENCY);
|
||||||
|
|
||||||
window.addEventListener("click", function () {
|
window.addEventListener("click", function () {
|
||||||
var keyboardRaised = shouldRaiseKeyboard();
|
var keyboardRaised = shouldRaiseKeyboard();
|
||||||
if(keyboardRaised && isKeyboardRaised) {
|
if (keyboardRaised && window.isKeyboardRaised) {
|
||||||
scheduleBringToView(150);
|
scheduleBringToView(150);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -99,7 +99,7 @@
|
||||||
|
|
||||||
window.addEventListener("blur", function () {
|
window.addEventListener("blur", function () {
|
||||||
isWindowFocused = false;
|
isWindowFocused = false;
|
||||||
isKeyboardRaised = false;
|
window.isKeyboardRaised = false;
|
||||||
isNumericKeyboard = false;
|
window.isNumericKeyboard = false;
|
||||||
});
|
});
|
||||||
})();
|
})();
|
||||||
|
|
|
@ -15,6 +15,9 @@ function setUpKeyboardControl() {
|
||||||
var KEYBOARD_HEIGHT = 200;
|
var KEYBOARD_HEIGHT = 200;
|
||||||
|
|
||||||
function raiseKeyboard() {
|
function raiseKeyboard() {
|
||||||
|
window.isKeyboardRaised = true;
|
||||||
|
window.isNumericKeyboard = this.type === "number";
|
||||||
|
|
||||||
if (lowerTimer !== null) {
|
if (lowerTimer !== null) {
|
||||||
clearTimeout(lowerTimer);
|
clearTimeout(lowerTimer);
|
||||||
lowerTimer = null;
|
lowerTimer = null;
|
||||||
|
@ -35,6 +38,9 @@ function setUpKeyboardControl() {
|
||||||
}
|
}
|
||||||
|
|
||||||
function doLowerKeyboard() {
|
function doLowerKeyboard() {
|
||||||
|
window.isKeyboardRaised = false;
|
||||||
|
window.isNumericKeyboard = false;
|
||||||
|
|
||||||
EventBridge.emitWebEvent("_LOWER_KEYBOARD");
|
EventBridge.emitWebEvent("_LOWER_KEYBOARD");
|
||||||
lowerTimer = null;
|
lowerTimer = null;
|
||||||
isRaised = false;
|
isRaised = false;
|
||||||
|
|
Loading…
Reference in a new issue