Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. Catching GPIO button events
Qt 6.12 LTS is out! See what's new in the release blog

Catching GPIO button events

Scheduled Pinned Locked Moved Unsolved Mobile and Embedded
1 Posts 1 Posters 833 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.
  • I Offline
    I Offline
    ivd0
    wrote on last edited by
    #1

    I need to catch GPIO button key presses in a Qt/QML application running on an Embedded Linux board.
    System-wise, events are recognized by evtest, but after installing event filter via installEventFilter() on QGuiApplication I only get QEvent::SockAct events, twice per press.
    Probably Qt listens on file descriptor and gets notifications, but they are not transformed into QKeyEvent.

    I'm running the app with the following variables set:

    export QWS_KEYBOARD="LinuxInput:/dev/input/event2"
    export QT_QPA_EVDEV_KEYBOARD_PARAMETERS=/dev/input/event2
    

    They have some effect at least:

    qt.qpa.input: Adding keyboard at "/dev/input/event2"
    qt.qpa.input: Try to create keyboard handler for "/dev/input/event2" ""
    qt.qpa.input: Opening keyboard at "/dev/input/event2"
    qt.qpa.input: Create keyboard handler with for device "/dev/input/event2"
    qt.qpa.input: Unload current keymap and restore built-in
    qt.qpa.input: numlock=0 , capslock=0, scrolllock=0
    qt.qpa.input: evdevmouse: Using device discovery
    

    But apparently this is not enough. Do I have to explicitly listen on /dev/iput/event2 device, or is there an easy way to re-use Qt key events?

    Thanks!

    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
    • Unsolved