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. QML physical keyboard open/closed detection and correct VKB usage for TextInput

QML physical keyboard open/closed detection and correct VKB usage for TextInput

Scheduled Pinned Locked Moved Mobile and Embedded
3 Posts 3 Posters 4.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.
  • D Offline
    D Offline
    deion
    wrote on last edited by
    #1

    Hi all,

    For my app I have a settings screen and right at the bottom of the screen there is QML TextInput element. When clicking it the VKB opens but the virtual keyboard (VKB) hides the TextInput; so I added a Flickable element around my settings screen, and when the TextInput gets focus I scroll the flickable up to make the TextInput visible on top of the VKB.
    However there are some issues with this approach:

    1. on N950 if the physical keyboard is open, the VKB will not appear when the TextInput is clicked (that's OK) however with my current code I am still scrolling the parent Flickable, even though this is now not necessary anymore. So is there a way to find out if the PHYSICAL keyboard is open on QML (even on C++ side)?
    2. The VKB is open and the TextInput has focus and scrolled on top; now if I press anywhere outside the TextInput the Flickable screen is scrolled to the original position so that now the TextInput element is back where it was originally (at the bottom of the screen) but now it is hidden by the VKB which now it is still open and the TextInput still has the focus. I can live with this behavior, this would be a way for the user to signal that it finished typing in the TextInput; so the user could say I'm finish typing in the TextInput by pressing the Return key on VKB or pressing anywhere in the screen outside the textInput and outside of VKB. But how do I detect now that the user pressed outside of the TextInput so I can hide the VKB?
    3. Is there a QML example/sample code that shows how to deal with this scenario? A TextInput that gets hidden when the VKB is open?

    Thanks & regards,
    Ionut Dediu

    1 Reply Last reply
    0
    • AlicemirrorA Offline
      AlicemirrorA Offline
      Alicemirror
      wrote on last edited by
      #2

      Hello,

      what platform are you using? It is very strange what you say. As I know the VKB should appear when you touch inside a tex input field and it gains the focus. Thus, the screen is positioned to the field immediately on top of the VKB. Then as you loose the input of the field, the keyboard disappear so you can manage scroll etc.

      Are you sure that you have set correctly the focus settings ? I have read in the documentation that it is a critical aspects to have the textual input working correctly.

      Enrico Miglino (aka Alicemirror)
      Balearic Dynamics
      Islas Baleares, Ibiza (Spain)
      www.balearicdynamics.com

      1 Reply Last reply
      0
      • X Offline
        X Offline
        xchg.ca
        wrote on last edited by
        #3

        [quote author="Alicemirror" date="1316520058"]Hello,
        Are you sure that you have set correctly the focus settings ? I have read in the documentation that it is a critical aspects to have the textual input working correctly.[/quote]

        I think this is fundamental issue with QT, why input fields don't loose focus when user tapped elsewhere?
        And what are the "correct focus settings" ?

        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