<div dir="ltr">Thank you for the clarification! I suspected as much, but wanted to be absolutely sure.<br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, Sep 2, 2022 at 5:11 PM Jonas Ã…dahl <<a href="mailto:jadahl@redhat.com">jadahl@redhat.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On Fri, Sep 02, 2022 at 04:14:26PM +0300, Maxim Kartashev wrote:<br>
> Java has an API that is supposed to return the number of buttons of the<br>
> mouse - MouseInfo.getNumberOfButtons()<br>
> <<a href="https://docs.oracle.com/javase/8/docs/api/java/awt/MouseInfo.html#getNumberOfButtons--" rel="noreferrer" target="_blank">https://docs.oracle.com/javase/8/docs/api/java/awt/MouseInfo.html#getNumberOfButtons--</a>>.<br>
> I wonder if it's possible to learn this number from Wayland somehow? The<br>
> protocol seems to not put any cap on the value of the button code in the<br>
> corresponding event.<br>
<br>
This information is currently not exposed via Wayland. What is exposed<br>
is a single abstracted "pointer" device for all combined pointing<br>
devices, including touchpads, traditional mouse devices, track points,<br>
and so on.<br>
<br>
It also doesn't expose current active global state to anyone wanting to<br>
query it, as pointer state is sent via events in response to focus<br>
changes or pointer movements, and are localized to surface local<br>
coordinates for the surface that currently has pointer focus.<br>
<br>
It appears that MouseInfo.getNumberOfButtons(), as well as<br>
PointerInfo.getDevice() and PointerInfo.getLocation() have no existing<br>
way to be implemented.<br>
<br>
Note that Wayland's approach to input events make this "hard" by design,<br>
as the intention is that clients react to abstracted high level<br>
localized input events only when they have active focus, to avoid<br>
leaking otherwise potentially sensitive information to clients not<br>
currently being actively used.<br>
<br>
<br>
Jonas<br>
<br>
</blockquote></div>