The SDL forums have moved to discourse.libsdl.org.
This is just a read-only archive of the previous forums, to keep old links working.


SDL Forum Index
SDL
Simple Directmedia Layer Forums
Wayland/libinput
Steven Newbury
Guest

I've been trying out SDL2 Wayland with both the Weston reference
compositor and gnome-shell/mutter-wayland. Graphics performance is
excellent, however mouse input is pretty much unusable.

Looking through the the current code bases, it seems right now the
Wayland support code in SDL only supports reading the current pointer
position relative to the focused surface, rather than distance moved
during the last time interval, this just about work as a workaround if
it the pointer wasn't bounded by the surface dimensions and could warp
from side to side, top to bottom, but it can't. Move the mouse too
far in any direction, and you hit the edge.

At least Weston and gnome-shell now both use libinput to abstract
input devices, this supports "relative mode" without issues, but I
can't find any documentation showing how this translates into an
accessible Wayland protocol API. Maybe somebody here knows?

While looking into all this, it occurs to me it would be rather useful
to have a driver for libinput directly, even if this would be
unsuitable for use with a compositor/xserver (where input is expected
to always go through the appropriate API)*, it would provide a nice
abstraction to evdev for use with touchscreens etc when using fbdev or
kms.

* Am I right here? Or would this be an alternative "raw" API?


_______________________________________________
SDL mailing list

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
Wayland/libinput
gabomdq


Joined: 28 Jul 2011
Posts: 495
Location: Argentina
2014-07-17 11:37 GMT-03:00 Steven Newbury:
Quote:
I've been trying out SDL2 Wayland with both the Weston reference
compositor and gnome-shell/mutter-wayland.  Graphics performance is
excellent, however mouse input is pretty much unusable.

Looking through the the current code bases, it seems right now the
Wayland support code in SDL only supports reading the current pointer
position relative to the focused surface, rather than distance moved
during the last time interval, this just about work as a workaround if
it the pointer wasn't bounded by the surface dimensions and could warp
from side to side, top to bottom, but it can't.  Move the mouse too
far in any direction, and you hit the edge.




There's no relative mouse/pointer grabbing support in Wayland AFAIK, there certainly was none when the backend landed (around the 1.4 Wayland release). They discussed it for 1.5 and it didn't land, I'm not aware of any recent developments.



 
Quote:

While looking into all this, it occurs to me it would be rather useful
to have a driver for libinput directly, even if this would be
unsuitable for use with a compositor/xserver (where input is expected
to always go through the appropriate API)*, it would provide a nice
abstraction to evdev for use with touchscreens etc when using fbdev or
kms.



SDL has support for evdev events for joystick/mouse/keyboard. Mouse and keyboard are only used with the Raspberry Pi backend right now.





--
Gabriel.
Wayland/libinput
Steven Newbury
Guest

On Thu, 2014-07-17 at 11:45 -0300, Gabriel Jacobo wrote:
Quote:
2014-07-17 11:37 GMT-03:00 Steven Newbury:

Quote:
I've been trying out SDL2 Wayland with both the Weston reference
compositor and gnome-shell/mutter-wayland. Graphics performance
is
excellent, however mouse input is pretty much unusable.
Looking through the the current code bases, it seems right now the
Wayland support code in SDL only supports reading the current
pointer
position relative to the focused surface, rather than distance
moved
during the last time interval, this just about work as a
workaround if
it the pointer wasn't bounded by the surface dimensions and could
warp
from side to side, top to bottom, but it can't. Move the mouse
too
far in any direction, and you hit the edge.


There's no relative mouse/pointer grabbing support in Wayland AFAIK,
there
certainly was none when the backend landed (around the 1.4 Wayland
release). They discussed it for 1.5 and it didn't land, I'm not
aware of
any recent developments.

I figured this must still be the case, but the low-level code has
landed in libinput which got my hopes up.
Quote:


Quote:
While looking into all this, it occurs to me it would be rather
useful
to have a driver for libinput directly, even if this would be
unsuitable for use with a compositor/xserver (where input is
expected
to always go through the appropriate API)*, it would provide a
nice
abstraction to evdev for use with touchscreens etc when using
fbdev or
kms.
SDL has support for evdev events for joystick/mouse/keyboard. Mouse
and
keyboard are only used with the Raspberry Pi backend right now.

Well, if there's no interest I won't bother hacking anything up, just
thought it might be useful. Smile


_______________________________________________
SDL mailing list

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
Wayland/libinput
Sam Lantinga


Joined: 10 Sep 2009
Posts: 1765
Ryan and I are talking with the Wayland folks. They understand the importance of relative mouse motion and are adding it to the API.


On Thu, Jul 17, 2014 at 7:45 AM, Gabriel Jacobo wrote:
Quote:

2014-07-17 11:37 GMT-03:00 Steven Newbury:
Quote:
I've been trying out SDL2 Wayland with both the Weston reference
compositor and gnome-shell/mutter-wayland.  Graphics performance is
excellent, however mouse input is pretty much unusable.

Looking through the the current code bases, it seems right now the
Wayland support code in SDL only supports reading the current pointer
position relative to the focused surface, rather than distance moved
during the last time interval, this just about work as a workaround if
it the pointer wasn't bounded by the surface dimensions and could warp
from side to side, top to bottom, but it can't.  Move the mouse too
far in any direction, and you hit the edge.





There's no relative mouse/pointer grabbing support in Wayland AFAIK, there certainly was none when the backend landed (around the 1.4 Wayland release). They discussed it for 1.5 and it didn't land, I'm not aware of any recent developments.



 
Quote:

While looking into all this, it occurs to me it would be rather useful
to have a driver for libinput directly, even if this would be
unsuitable for use with a compositor/xserver (where input is expected
to always go through the appropriate API)*, it would provide a nice
abstraction to evdev for use with touchscreens etc when using fbdev or
kms.




SDL has support for evdev events for joystick/mouse/keyboard. Mouse and keyboard are only used with the Raspberry Pi backend right now.





--
Gabriel.


_______________________________________________
SDL mailing list

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org