QtQuick with rotary encoder to navigate Menu and adjust Slider, SpinBox etc
-
Hi
QtQuick with rotary encoder to navigate Menu and adjust Slider, SpinBox etc
Which is the recommended/supported approach for this please?
Which examples and/or docs cover this please?The multifunction display (MFD) has a touchscreen, several buttons and a rotary encoder.
The button driver produces function key events.
The rotary encoder driver produces mouse scroll wheel events.This is 80% working via workarounds, but we are going in circles searching for a way that is 100% supported by QtQuick/QML.
The first issue is that QtQuick Menu, Slider, SpinBox etc support the scroll wheel, but only when the mouse pointer is over them... multifunction displays do not have a mouse pointer, only the rotary encoder/scroll wheel...
A partial workaround is to try to convert QWheelEvent to QKeyEvent using installEventFilter/WheelListener/postEvent, but that introduces further issues:
https://bugreports.qt.io/browse/QTBUG-136694Thank you
-
As a workaround we have patched the linux rotary encoder driver to be able to send <KEY_UP> and <KEY_DOWN>, as an alternative to mouse wheel events.
i.e. patched drivers/input/misc/rotary_encoder.c to input_report_key, as an alternative to input_report_rel.
Saves having to filter and convert wheel events, to key events, in each Qt app.