Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. QT keyboard with repeat option
Forum Updated to NodeBB v4.3 + New Features

QT keyboard with repeat option

Scheduled Pinned Locked Moved Unsolved Mobile and Embedded
2 Posts 1 Posters 261 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.
  • N Offline
    N Offline
    NightFury
    wrote on last edited by NightFury
    #1

    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 as

    function 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 as

    import 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
            ........
        }
    }
    
    1 Reply Last reply
    0
    • N Offline
      N Offline
      NightFury
      wrote on last edited by
      #2

      Which is the even generated when we press the "1/2" key in virtual keyboard ?
      keyboard.JPG
      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)
          }
      }
      
      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