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. How to correctly use the virtual keyboard
Forum Updated to NodeBB v4.3 + New Features

How to correctly use the virtual keyboard

Scheduled Pinned Locked Moved Solved QML and Qt Quick
2 Posts 1 Posters 1.6k Views
  • 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.
  • T Offline
    T Offline
    tasptz
    wrote on last edited by tasptz
    #1

    I am trying to use the virtual keyboard in a qml based desktop application that may run in fullscreen or windowed mode.
    The documentation does not make it clear to me how I do this right.

    What I fiddled together now is:

    // imports
    
    ApplicationWindow  {
    
      // other components
    
      InputPanel {
        id: virtualKeyboard
        anchors.bottom: parent.bottom
        width: parent.width
        visible: InputContext.focus
        z: 10 
      }
    }
    

    In principle this behaves as I want it to. However the HideKeyboardKey does nothing.
    So is this the intended way to use these qml components or am I on the wrong track? How would I catch if the HideKeyboardKey is pressed?

    update
    I can catch key presses with

                InputContext.inputEngine.virtualKeyClicked.connect(function (key, text, modifiers) {
                  console.log('click ' + text)
                })
    

    but the HideKeyboardKey does not trigger this signal.

    1 Reply Last reply
    0
    • T Offline
      T Offline
      tasptz
      wrote on last edited by
      #2

      I went through the whole documentation again and in the only available example there is a comment

      /*  The visibility of the InputPanel can be bound to the Qt.inputMethod.visible property, ...
      

      So I tried that and it works.

          InputPanel {
              anchors.bottom: parent.bottom
              width: parent.width
              visible: Qt.inputMethod.visible
              z: 10
          }
      
      1 Reply Last reply
      1

      • Login

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