Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Special Interest Groups
  3. QtonPi
  4. Qt5 doesn’t grab keyboard strokes
Forum Updated to NodeBB v4.3 + New Features

Qt5 doesn’t grab keyboard strokes

Scheduled Pinned Locked Moved QtonPi
4 Posts 3 Posters 3.8k Views 1 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.
  • D Offline
    D Offline
    dplamp
    wrote on last edited by
    #1

    I already posted this message, but perhaps in the wrong sub forum...

    I made a small test app in C++ (no QML). The main widget is a QWidget. It has 1 QLineEdit, 1 QSpinBox and 2 QPushButton. One to quit, the other to show the “About Qt” dialog.

    I can type text and numbers in QLineEdit and QSpinBox as long as I change the focus with the tab key. If I use the mouse to change the focus or if I show the “About Qt” dialog, the characters I type go to the console instead of my Qt app : I can see them when I quit.

    I run the app with the CLI option : -platform eglfs, kernel v3.6, Raspbian Wheezy, RPi model B.

    Any idea ?

    1 Reply Last reply
    0
    • D Offline
      D Offline
      DenLadeSide
      wrote on last edited by
      #2

      I have a QML/WebView in Qt5, where I see a similar behavior when I enter text in text boxes in web pages. The text does get picked up by webkit and all the events seem to be ok. However, there are two interesting issues:

      1. key strokes get repeated in the console when I exit the application (didn't verify if it happens on-the-fly or after - but looks like the same as your issue)
      2. when pressing/releasing the shift key, strange unicode characters are entered in the strings I am editing - very frustrating (they are not visible - but breaks some code I did).
      1 Reply Last reply
      0
      • D Offline
        D Offline
        dplamp
        wrote on last edited by
        #3

        I did not have a chance to dig into it again, but I just tested it is the same when the program is started with and without the X server.

        1 Reply Last reply
        0
        • W Offline
          W Offline
          WolfEng
          wrote on last edited by
          #4

          It has sure been a few months since this was first asked, I wonder if any of you got around this problem....

          I'm running a Qt 5 QML app on a Raspberry Pi without running the Xserver and while all things seem to work alright I get nasty behavior such as the application quitting when Ctrl + C is pressed. And ultimately if you write something like "sudo reboot" you end up being able to reboot the RPi from within the app..

          I've tried having catching events in a Root element and setting the event as accepted, I've also tried redirecting the application's output to a file when running it but it just won't budge.

          I was thinking of looking into ways to completely disable the terminal (my application is supposed to run in a kind of "kiosk" mode so I wouldn't mind crippling the Linux underneath, but I still think there should be a way of doing it direclty from Qt, hopefully you guys managed to solve it...

          Thanks in advance,

          Wolf

          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