Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. Key Return Press event for Virtual Keyboard
Qt 6.11 is out! See what's new in the release blog

Key Return Press event for Virtual Keyboard

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
3 Posts 2 Posters 1.1k Views 2 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • P Offline
    P Offline
    Priyanka kotian
    wrote on last edited by
    #1

    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.

    1 Reply Last reply
    0
    • Aleksey_KA Offline
      Aleksey_KA Offline
      Aleksey_K
      wrote on last edited by
      #2

      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/594592

      however Qt not going to fix it:

      https://bugreports.qt.io/browse/QTBUG-69480?page=com.atlassian.jira.plugin.system.issuetabpanels%3Acomment-tabpanel&showAll=true

      1 Reply Last reply
      0
      • Aleksey_KA Offline
        Aleksey_KA Offline
        Aleksey_K
        wrote on last edited by
        #3

        Found the solution. Following workaround works for me:

        TextArea {
            onActiveFocusChanged: {
                if(activeFocus) {
                    Qt.inputMethod.update(Qt.ImQueryInput)
                }
            }
        }
        

        Works with other controls as well.

        1 Reply Last reply
        0

        • Login

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved