QTVirtualKeyboard plugin - disabled keys are enabled if layout was switched
Unsolved
General and Desktop
-
Hi,
I have a strange behaviour of the qtvirtualkeyboard plugin. You can see it in this video:
https://photos.google.com/share/AF1QipN1DZ7nxCBw0SsPms0fbwigPp5PFC0WjrWV6_ZaSiU4gLdKXfSZsgX2K2APsVyzSQ/photo/AF1QipOOd816PxVThdp6eP-kQjPEIzmsFmeRaSmEor0?key=N3p5dTNYbUJkd2FPbm9MM3EyQnJxNXZqeEFYMFZ3If the user switches between "&123" and "ABC" layout, everything is fine - all disabled keys are still disabled. But if the user switches between "1/2" and "2/2" layout, they are enabled again. But if you then switch again between "&123" and "ABC" they are disabled again. Thats strange.
What can be wrong? Or how can I fix this?
This is my code to disable the keys (by now I have no code to enable them again, so they must be disabled still):
property var keyboardLayout: inputPanel.keyboard.layout property var specialKeysDiabled: false function disableSpecialKeys(parent) { specialKeysDiabled = true var obj = null if (typeof parent == "undefined" || !parent) { parent = inputPanel.keyboard } var children = parent.children for (var i = 0; i < children.length; i++) { obj = children[i] if ( /[^a-zA-Z0-9\(\)_\s]/.test(obj.text) && obj.toString().substring(0, 7) === "BaseKey" ) { obj.enabled = false } if (obj === null) { break } obj = disableSpecialKeys(obj) if (obj) { break } } return obj } onKeyboardLayoutChanged: { if (keyboardLayout !== "") { if (specialKeysDiabled) { disableSpecialKeys() } } }