Axis events to keyboard focus (Re: Input and games.)
Rick Yorgason
rick at firefang.com
Fri May 10 03:10:22 PDT 2013
Peter Hutterer <peter.hutterer at ...> writes:
> > >assuming we have two clients C1, C2, and C1 has the gamepad open, what is
> > >the behaviour of the gamepad and the shared pointer:
> >
> > >- when the gp-controlled pointer enters/leaves C1's surface
> > >- when the gp-controlled pointer enters and clicks inside the surface
> > >- when the compositor changes the keyboard and/or gamepad focus to C1's
> > > surface while the gp-controlled pointer is inside or outside the surface,
> > > respectively
> >
> > Because C1 has the gamepad open, the pointer is no longer shared,
> > and it thus acts exactly like the pointer is only controlled by the
> > mouse. There is no gp-controlled pointer.
>
> this makes C1 a pointer-trap, similar to qemu's behaviour under X. if you
> accidentally move onto the surface, you cannot escape unless you change the
> physical device to move the pointer. less than ideal, imo
The answer to the first scenario depends on the compositor's focus model: if
it has "focus follows mouse", I suppose Bill's answer is right, but with
"click to focus" I would expect the gamepad to continue controlling the
pointer until you click on the surface.
Everywhere else, though, you're too worried about pointer traps. Remember,
you would still be able to move the pointer with the mouse, and what's more,
more often than not games are *expected* to trap the pointer. Kristian even
implemented a pointer lock feature at the protocol level specifically so
that you *can* trap the pointer.
However, if any compositors add this feature, I would hope it's not enabled
by default.
Consider the Guitar Hero controller. Every feature on the Guitar Hero
controller maps to a button or axis on the 360 controller. One of those
features is the tilt sensor, which fires off an axis message when the guitar
isn't in its expected orientation. So if your guitar is lying down on your
desk, it would cause your cursor to automatically slide to one direction.
-Rick-
More information about the wayland-devel
mailing list