Details
-
Suggestion
-
Resolution: Done
-
P2: Important
-
4.7.1, 5.1.0 RC2
-
d1fbfbbab7f78e0a1050acce3540c02660a0d68f 52954268e9202e33eb8c2db93a51d55a2596051b
Description
I have a use case where I would like to use a ListView in my QML UI, however need to disable all mouse interaction with our application and use keyboard only input. The mouse "device" is still active, however (by which I mean the system has a mouse interface that can still be used to select things).
Setting the "interactive" property of the ListView to false also disables the ListView's own handling of keyboard events in addition to the Mouse events, which is not my desired outcome.
I have tried a workaround where I add a child MouseArea to the ListView and have a handler for onPressed where I simply set the accepted property of the mouse event to true, however this had no effect.
Currently to achieve the above I have to have my own handlers for the keyboard (e.g. Keys.onDownPressed) and manually change the currentItem property of the ListView.
Maybe a new property could be added, or the "interactive" property of a flickable could have some enum dictating the following:
Mouse+Keyboard input accepted (default)
Only Mouse events dealt with
Only Keyboard events dealt with
No events dealt with at all.