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. onscreen Keyboard popup up with or without focus
Forum Updated to NodeBB v4.3 + New Features

onscreen Keyboard popup up with or without focus

Scheduled Pinned Locked Moved Unsolved Qt for WebAssembly
webassemblyscreenkeyboardc++wasminputdevice
3 Posts 3 Posters 1.7k 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.
  • L Offline
    L Offline
    Labidi Ahmed
    wrote on 27 May 2022, 08:21 last edited by Labidi Ahmed 6 Feb 2022, 07:18
    #1

    Hello,

    I am working on an application to be deployed as a wasm app and a windows application.

    we are using a windows 10 OS touch screen tablet and google chrome to access the web app. am using an empty new qt project to demonstrate the problem :

    The onscreen Keyboard popups up regardless of focus meaning it will pop up wherever i touch the screen:

    • if btn is pressed
    • if lineedit is selected
    • if empty widget space is touched even though there is no focus object behind it.

    i include a link to this better quality Behaviour Video so you can see the problem.
    screen-capture_qt_touch_screen_problem_2_edit.gif
    the onscreen Keyboard popup without focus problem occurs only if i compile for webassmebly, works fine on the same tablet for MSVC.

    what i tried :

    1. catch the events then ignore them using :
    ui->centralwidget->installEventFilter(this);
    bool MainWindow::eventFilter(QObject *obj, QEvent *event)
    {
    //print event to qdebug 
    static int eventEnumIndex = QEvent::staticMetaObject.indexOfEnumerator("Type");
     QString TEXT_Event =  QEvent::staticMetaObject.enumerator(eventEnumIndex).valueToKey(event->type());;
     qDebug()<<"TEXT EVENT="<<TEXT_Event;
     if(TEXT_Event.contains("Paint")){
    //dont show print event
       }else{
         ui->Main_PlainTextEdit->appendPlainText(obj->objectName()+"=>"+TEXT_Event);
       }
    
     if( event->type()==QEvent::MouseButtonPress|| event->type()==QEvent::MouseButtonRelease)
      {
          // handle on-screen keyboard
          event->ignore();
          event->accept();
      }
          return true;
    }
    
    1. setAttribute(Qt::WA_TransparentForMouseEvents);

    not OK as it deactivates all mouse input => no interaction possible,

    1. setAttribute(Qt::WA_AcceptTouchEvents);

    This only changes the event from Mouse event to touch event.

    Maybe there is an option that i need to tick in the form editor or touchscreen option that needs to be activated, maybe the way to catch and ignore event i implemented is wrong.

    I don't know what i am doing wrong but all my attempts to fix this didn't work, please help guide me ?

    Thank you in advance.

    1 Reply Last reply
    1
    • S Offline
      S Offline
      swurl
      wrote on 2 Jan 2025, 21:38 last edited by
      #2

      Also seeing this issue, did you ever find a solution?

      1 Reply Last reply
      0
      • E Offline
        E Offline
        Even Oscar Andersen
        wrote on 17 Feb 2025, 17:00 last edited by
        #3

        This might be QTBUG-133781, which release are you using ?

        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