Unsolved QT keyboard with repeat option
-
In my application I am using TextInput{ .. } and InputPanel { .. } in qml and I am able to invoke the keyboard and things work without any issue. I need repeated entry of a character when it is pressed continuously. [Ex. Long press of ‘a’ should return ‘aaaaaaaa..’]. But in my case it pops up the special character similar to a and it does not enter a until the press is released.
. I tried with below function asfunction setupKeys(parent) { var obj = null if (parent === null) return null var children = parent.children for (var i = 0; i < children.length; i++) { obj = children[i] if (obj.toString().substring(0, 7) === "BaseKey") { //THIS IS NEVER INVOKED!! obj.alternativeKeys="" obj.repeat=true obj.showPreview=false } obj = setupKeys(obj) if (obj) break }
to enable the “obj.repeat=true” but as I mentioned in the comments there, it is never invoked.
I call the function asimport QtQuick 2.6 import QtQuick.Controls 1.5 import QtQuick.Dialogs 1.1 import QtQuick.VirtualKeyboard 2.4 import QtQuick.Controls.Styles 1.4 Item { ...... TextInput { ...... Component.onCompleted: { ...... setupKeys(inputPanel.keyboard) } } InputPanel { id: inputPanel ........ } }
-
Which is the even generated when we press the "1/2" key in virtual keyboard ?
I see the signal for all others keys but when I click this it generates no event.
I use below code in qml to check :TextInput{ .... Keys.onPressed: { console.log("Current KEY pressed :",event.key) } }