Unsolved Key Return Press event for Virtual Keyboard
-
I have created a custom layouts for Virtual Keyboard. I have a KeyboardLayout inside which i have KeyRow and then Keys. On click on the Key, we have to send a sendKeyClick event with the Key text and the modifier. I am using the InputContext.sendKeyClick(key,text) method. But it throws the error "InputContext::sendKeyClick(): no focus to send key click""- QGuiApplication::focusWindow() is: application Window?
The Focus is on the TextField.
-
Have same bug with regular Qt Virtual KeyBoard.
qt.virtualkeyboard: InputContext::sendKeyClick(): no focus to send key click - QGuiApplication::focusWindow() is: QWidgetWindow(0x493c910, name="MainWindowWindow")
Bug happen unpredictable in
TextArea
. Seems old bug and related to this one: https://forum.qt.io/post/594592however Qt not going to fix it:
-
Found the solution. Following workaround works for me:
TextArea { onActiveFocusChanged: { if(activeFocus) { Qt.inputMethod.update(Qt.ImQueryInput) } } }
Works with other controls as well.