Unsolved Catching GPIO button events
-
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!