Am 2017-08-05 17:23, schrieb René J. V. Bertin:
David Edmundson wrote:
In wayland you never query anything, only track events.
There are applications for which this isn't good enough but I guess
be other, low-level ways to query the current state of a given input
Short answer: no there isn't. Even libinput does not provide the state
of the buttons, but just sends the press events. I'm pretty sure that
not even the kernel knows it, otherwise libinput would expose it.
What actually do you want to do?
I'm toying around with a click-and-hold-opens-the-contextmenu feature
from Mac where this makes a bit more sense), based on the TapAndHold
looks like that event is good demonstration why event tracking isn't
reliable. When I activate processing of that gesture on a QToolButton
menu, it finishes (triggers) even when I am not holding any mouse
event filter in which I implement this feature also catches
MouseMove events (to turn off the gesture processing); I'm not getting
either when the QToolButton's menu is open.
IOW, when I click once on the button to open its menu, the contextmenu
too after the expected delay. The only reliable way I found to prevent
to check if the mouse button is still pressed when the TapAndHold
to be finished.
For Wayland you can use the KWayland Client library to low level listen
to the button press/release events. Example code for how to do this is
in breeze kstyle for manual moving of the window.