How to learn the number of mouse buttons from Wayland?
Maxim Kartashev
maxim.kartashev at jetbrains.com
Fri Sep 2 14:52:26 UTC 2022
Thank you for the clarification! I suspected as much, but wanted to be
absolutely sure.
On Fri, Sep 2, 2022 at 5:11 PM Jonas Ådahl <jadahl at redhat.com> wrote:
> On Fri, Sep 02, 2022 at 04:14:26PM +0300, Maxim Kartashev wrote:
> > Java has an API that is supposed to return the number of buttons of the
> > mouse - MouseInfo.getNumberOfButtons()
> > <
> https://docs.oracle.com/javase/8/docs/api/java/awt/MouseInfo.html#getNumberOfButtons--
> >.
> > I wonder if it's possible to learn this number from Wayland somehow? The
> > protocol seems to not put any cap on the value of the button code in the
> > corresponding event.
>
> This information is currently not exposed via Wayland. What is exposed
> is a single abstracted "pointer" device for all combined pointing
> devices, including touchpads, traditional mouse devices, track points,
> and so on.
>
> It also doesn't expose current active global state to anyone wanting to
> query it, as pointer state is sent via events in response to focus
> changes or pointer movements, and are localized to surface local
> coordinates for the surface that currently has pointer focus.
>
> It appears that MouseInfo.getNumberOfButtons(), as well as
> PointerInfo.getDevice() and PointerInfo.getLocation() have no existing
> way to be implemented.
>
> Note that Wayland's approach to input events make this "hard" by design,
> as the intention is that clients react to abstracted high level
> localized input events only when they have active focus, to avoid
> leaking otherwise potentially sensitive information to clients not
> currently being actively used.
>
>
> Jonas
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/wakefield-dev/attachments/20220902/a23407d1/attachment.htm>
More information about the wakefield-dev
mailing list