Using Soft Keys with Weston & Libinput

Peter Hutterer peter.hutterer at who-t.net
Fri Feb 5 06:15:58 UTC 2016


On Thu, Feb 04, 2016 at 10:38:18AM +0000, Ucan, Emre (ADITG/SW1) wrote:
> Hi,
> 
> We want to use soft keys with weston.
> 
> The use-case is very similar to android that the touch panel is bigger than the display.
> The out of display touch events should be routed to the clients as key events.
> 
> As far as I understood, It is not possible to realize this use-case in current weston implementation,
> because the coordinates of touch events are scaled to width and height of the display with libinput_event_touch_get_x(y)_transformed API.
> 
> For example, when I touch a soft key (outside of display), the grab interface will still get a touch event in the range of display width and height,
> and It will wrongly route this event to a wl_surface which is on the edge of the display. Weston cannot recognize that the event happened outside of the display.
> 
> Is there a way to realize this use-case that I do not know ?

short answer: you'll need code in weston to handle this. 

libinput doesn't care about the display, it merely takes the touch
coordinates, the API then tells libinput to scale the range into that
coordinate set. If you screen has an offset, you need to detect that and
handle it separately but that is not something weston currently does.

with the current APIs what you'll need to do is check the mm value for the
display, calculate if it is outside the boundary you want and handle it
accordingly. if it is within the display boundary, then you can pass it on
normally.

Cheers,
   Peter


More information about the wayland-devel mailing list