Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt for WebAssembly
  4. Virtual Keyboard and WebAssembly

Virtual Keyboard and WebAssembly

Scheduled Pinned Locked Moved Unsolved Qt for WebAssembly
9 Posts 6 Posters 1.3k 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.
  • R Offline
    R Offline
    Renio
    wrote on 8 Jul 2022, 12:09 last edited by Renio 7 Aug 2022, 12:31
    #1

    I need to work whit a virtual keyboard in my WebAssembly project.
    in qt examples there is only one example showed here:
    https://doc.qt.io/qt-6/qtvirtualkeyboard-index.html
    Now, I build this example in Desktop modality and works fine.
    But when I build it in WebAssembly, this program don't work!
    When I click on lineinput item, the virtual Keyboard appair for a very short time, then disappair.
    But if I click on dialog body the keyboard reappair magically and disappair.
    First Question: is this the correct behaviour?
    I created a similar project using QWidget. this program works in Desktop modality.
    Don't work in webaasembly modality.
    The Keyboard is never dispalyed.
    I tried to change the the windowModality properties and nothing is changed.
    https://forum.qt.io/topic/123986/modal-dialogs-break-virtual-keyboard
    Second Question: Wich is the correct mode to use the qtvirtualkeyboard in a WebAssembly project
    In the tecnical guide,
    https://doc.qt.io/qt-6/technical-guide.html
    isn't explained how to include this plugin into the project

    #include "DialogSandBox.h"
    
    #include <QApplication>
    
    int main(int argc, char *argv[])
    {
        qputenv("QT_IM_MODULE", QByteArray("qtvirtualkeyboard"));
        QApplication a(argc, argv);
        DialogSandBox w;
        w.show();
        return a.exec();
    }
    

    DialogSandBox.PNG

    1 Reply Last reply
    0
    • M Offline
      M Offline
      matthk
      wrote on 20 Jul 2022, 21:21 last edited by matthk
      #2

      look here

      It's still unsolved.

      1 Reply Last reply
      0
      • L Offline
        L Offline
        lorn.potter
        wrote on 27 Jul 2022, 20:51 last edited by
        #3

        In Qt 6.4 the native virtual keyboard on mobile has been improved, so you won't necessarily need the qt virtual keyboard for wasm.

        Freelance Software Engineer, Platform Maintainer QtWebAssembly, Maintainer QtSensors
        Author, Hands-On Mobile and Embedded Development with Qt 5 http://bit.ly/HandsOnMobileEmbedded

        C S 2 Replies Last reply 8 Nov 2022, 11:26
        0
        • L lorn.potter
          27 Jul 2022, 20:51

          In Qt 6.4 the native virtual keyboard on mobile has been improved, so you won't necessarily need the qt virtual keyboard for wasm.

          C Offline
          C Offline
          cactus
          wrote on 8 Nov 2022, 11:26 last edited by
          #4

          @lorn-potter im using 6.4 , on android browsers keyboard keyboard comes up but no typing. and for ios keyboard not open !!!

          1 Reply Last reply
          1
          • L lorn.potter
            27 Jul 2022, 20:51

            In Qt 6.4 the native virtual keyboard on mobile has been improved, so you won't necessarily need the qt virtual keyboard for wasm.

            S Offline
            S Offline
            SteHie
            wrote on 5 Dec 2022, 23:32 last edited by
            #5

            @lorn-potter Same Problem. Use 6.4.1 wasm and native Keyboard. In textfild Keyboard occurs, but no press is moving to qt... Do you have a solution?
            Stefan

            1 Reply Last reply
            1
            • B Offline
              B Offline
              brett-dalton
              wrote on 2 May 2023, 19:32 last edited by
              #6

              I'm still experiencing this problem in 6.5, and I'm checking 6.6 now. Has anyone managed to get virtual keyboard input working? I can force it to appear, but it does not send events to input fields. I get a "input method is not set" error message in the console, which suggests the virtual keyboard does not detect the field is focused. I'm testing mostly in firefox/chrome on desktop, but when I tested on mobile the behavior was the same.

              L 1 Reply Last reply 3 May 2023, 05:07
              0
              • B brett-dalton
                2 May 2023, 19:32

                I'm still experiencing this problem in 6.5, and I'm checking 6.6 now. Has anyone managed to get virtual keyboard input working? I can force it to appear, but it does not send events to input fields. I get a "input method is not set" error message in the console, which suggests the virtual keyboard does not detect the field is focused. I'm testing mostly in firefox/chrome on desktop, but when I tested on mobile the behavior was the same.

                L Offline
                L Offline
                lorn.potter
                wrote on 3 May 2023, 05:07 last edited by
                #7

                @brett-dalton
                The Qt virtual keyboard works with widget apps. I am currenty looking at a bug where it is not working with declarative apps, but that one is that it doesn't show at all.

                Freelance Software Engineer, Platform Maintainer QtWebAssembly, Maintainer QtSensors
                Author, Hands-On Mobile and Embedded Development with Qt 5 http://bit.ly/HandsOnMobileEmbedded

                B 1 Reply Last reply 3 May 2023, 20:47
                0
                • L lorn.potter
                  3 May 2023, 05:07

                  @brett-dalton
                  The Qt virtual keyboard works with widget apps. I am currenty looking at a bug where it is not working with declarative apps, but that one is that it doesn't show at all.

                  B Offline
                  B Offline
                  brett-dalton
                  wrote on 3 May 2023, 20:47 last edited by brett-dalton 5 Mar 2023, 21:22
                  #8

                  @lorn-potter

                  Yes I've been working with a QT Quick app. As you say, the keyboard doesn't appear normally, but I forced it to be visible. In my App.qml file I have modified the auto-generated InputPanel:

                      InputPanel {
                          id: inputPanel
                          property bool showKeyboard :  active
                          //y: showKeyboard ? parent.height - height : parent.height
                          y: parent.height - height
                          // ...
                      }
                  

                  Not that this fixes the keyboard. It still can't be used to enter text. But when I press a key I see an error "input method is not set" in the browser console. I'm not familiar with the input system, but maybe that's useful info for your debugging,

                  I will try to see if I can get the keyboard working with a QML widget in a widget app. Maybe that will be a suitable workaround.

                  S 1 Reply Last reply 19 Sept 2023, 15:47
                  0
                  • B brett-dalton
                    3 May 2023, 20:47

                    @lorn-potter

                    Yes I've been working with a QT Quick app. As you say, the keyboard doesn't appear normally, but I forced it to be visible. In my App.qml file I have modified the auto-generated InputPanel:

                        InputPanel {
                            id: inputPanel
                            property bool showKeyboard :  active
                            //y: showKeyboard ? parent.height - height : parent.height
                            y: parent.height - height
                            // ...
                        }
                    

                    Not that this fixes the keyboard. It still can't be used to enter text. But when I press a key I see an error "input method is not set" in the browser console. I'm not familiar with the input system, but maybe that's useful info for your debugging,

                    I will try to see if I can get the keyboard working with a QML widget in a widget app. Maybe that will be a suitable workaround.

                    S Offline
                    S Offline
                    SteHie
                    wrote on 19 Sept 2023, 15:47 last edited by
                    #9

                    @brett-dalton
                    Did you find a solution?

                    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