qtqtvirtualkeyboard

QT, How to focus on virtualkeyboard, and use keyboard to control virtualkeyboard


I'm using virtualkeyboard of Qt5 on embedded device, and no mouse, the keyboard is not full pc keyboard, but just has eleven keys, which include up/down/left/right, enter, esc....

so I want focus on virtualkeyboard, and use up/down/left/right/enter to control virtualkeyboard, simulate mouse to click on virtual key.

how to do?


Solution

  • There doc.qt.io/qt-5/qtvirtualkeyboard-build.html mentioned that qtvirtualkeyboard should be build with arrow-key-navigation option. Like this

    qmake /path/to/qtvirtualkeyboard.pro CONFIG+=arrow-key-navigation
    

    Also recommend to build examples/virtualkeyboard/basic/ with disable-desktop option and use it sources as example.