Qt World Summit: Register Today!

Unable to get the keyboard and mouse pointer in QT application

  • HI,
    I have successfully cross compiled QT-5.3.2 for my ARM board and then I have deploy all the QT libraries on to the board. Now I am trying to run the QT application after setting the environment variables like

    export QT_QPA_FONTDIR=/opt/qt/lib/fonts
    export QT_QPA_PLATFORM_PLUGIN_PATH=/opt/qt/plugins/platforms
    export LD_LIBRARY_PATH=/opt/qt/lib

    I am also supplying the platform and plugin parameters as below:

    qtapplication -platform linuxfb:fb=/dev/fb3 -plugin evdevmouse -plugin evdevkeyboard

    but I don't see the mouse or keyboard.

    On my bootlogs I can see both usb (keyboard and mouse) got detected but its QT application which doesn't detect keyboard and mouse.


  • solved now.

  • Lifetime Qt Champion

    What was the problem ?

  • Hello, everyone!
    I have the same problem, but my system is x86_64. I ran my app in my system (static kernel and initrd only, using all binaries from My Desktop system). In my notebook my app runs fine, but when running over my system, I can see neither mouse nor keyboard.

    I'm trying my system over a virtual machine.

    I can get events in /dev/input/event6 (to mouse) and /dev/input/event0 (to my keyboard). I tried this one using cat:
    cat /dev/input/event6
    And moving the mouse I can see the events.

    I tried redirect QT_DEBUG_PLUGINS to a log file, but the results is a binary file!
    I did the same in my notebook and I can see the log correctly.

    Since the app locks the screen, I can't back to console and this way is impossible to see anything generate by app.

    Do you have some tip for me?

  • Sorry, I forgot to show my parameters.
    I tried without pass device path, the last I tried as below:

    export QT_QPA_PLATFORM=linuxfb:fb=/dev/fb0,tty=/dev/tty1
    export QT_QPA_GENERIC_PLUGINS=evdevkeyboard:/dev/input/event0,evdevmouse:/dev/input/event6

    ANd now, I tried some parameters more:
    export QT_QPA_PLATFORM_PLUGIN_PATH=/opt/qt/plugins/platforms

    Unfortunately, I have no ideas for now.

  • Lifetime Qt Champion

    To see what might be happening you should connect to your device through SSH and then start the application, this way you should be able to see if you have any error message.

  • Hello!
    Thank you to answer!
    My system doesn't have a ssh, but you gave me a idea. I wrote a QTimer with a single shot to 5 seconds closing my application.

    I did a redirect from stdout to file, but stdout isn't writing nothing.

    Then I did a redirect from stderr to file and I saw the a structure from application loading the module correctly. I couldn't see errors in debuging mode. I wrote a shortcut to close my app with Ctrl+Q, but my keyboard is not working too.

    I'm not sure, but the terminal could be the problem. I will see this one a bit more.
    Thank you again!

  • I needed to add one more line in my parameters:

    export QT_PLUGIN_PATH=/opt/qt/plugins along with
    export QT_QPA_PLATFORM_PLUGIN_PATH=/opt/qt/plugins/platform

    and it worked with out any error.

Log in to reply