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. QPlatformInputContext::filterEvent not called
Forum Updated to NodeBB v4.3 + New Features

QPlatformInputContext::filterEvent not called

Scheduled Pinned Locked Moved Mobile and Embedded
6 Posts 2 Posters 1.8k Views 2 Watching
  • 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.
  • T Offline
    T Offline
    th.thielemann
    wrote on last edited by
    #1

    I wrote my own inputcontext class derived from QPlatformInputContext. But on one of my linux devices the filterEvent method is not called in case I press a key. But the keystrokes from external keyboard goes into my widgets as expected - text is written.
    On my desktop machine (Windows + VMware + Ubuntu 12.04) everything is fine.
    Any reasons for this behaviour?

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      You should give more information about the setup where the filter is not working compared to the one where it's currently working.

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0
      • T Offline
        T Offline
        th.thielemann
        wrote on last edited by
        #3

        The difference is X11 versus embedded.

        One desktop X11 is available. Thus the xcb plugin is used.
        One the other system eglfs is used. The call of the application is ./MyApp -platform eglfs -plugin evdevkeyboard
        I can debug into the plugin and the keystrokes are handled there and following plugin method is called.
        But the event does not reach by plugin.

        void QEvdevKeyboardHandler::processKeyEvent(int nativecode, int unicode, int qtcode,
                                                    Qt::KeyboardModifiers modifiers, bool isPress, bool autoRepeat)
        {
            QWindowSystemInterface::handleExtendedKeyEvent(0, (isPress ? QEvent::KeyPress : QEvent::KeyRelease),
                                                           qtcode, modifiers, nativecode + 8, 0, int(modifiers),
                                                           (unicode != 0xffff ) ? QString(unicode) : QString(), autoRepeat);
        }
        

        Regards,
        Thomas

        1 Reply Last reply
        0
        • SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on last edited by
          #4

          What do you mean by "the event does not reach by plugin" ?

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          T 1 Reply Last reply
          0
          • SGaistS SGaist

            What do you mean by "the event does not reach by plugin" ?

            T Offline
            T Offline
            th.thielemann
            wrote on last edited by
            #5

            @SGaist
            My plugin derives from QPlatformInputContext. The method QPlatformInputContext::filterEvent(const QEvent *event) is called for events in case I use qxcb. I want to achieve the same behaviour in case I use eglfs. In eglfs the plugin generic/libqevdevkeyboardplugin.so is loaded, which containts the code in my previous post.
            Either there is a specific setting possible or I have to read the keyboard outcome by myself.

            Regards,
            Thomas

            1 Reply Last reply
            0
            • SGaistS Offline
              SGaistS Offline
              SGaist
              Lifetime Qt Champion
              wrote on last edited by
              #6

              From a quick look it seems that the QEvdevKeyboardHandler class doesn't take QPlatformInputContext at all while it's integrated in the xcb backend. You could try adding it to QEvdevKeyboardHandler

              Interested in AI ? www.idiap.ch
              Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

              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