Gamepad focus model (Re: Input and games.)

Rick Yorgason rick at firefang.com
Tue May 14 16:10:30 PDT 2013


Hi Bill,

In reply to everything below, I don't think there's anything in any of 
the proposals that prevents compositors from implementing pointer 
emulation for gamepads, or from suspending that emulation when a game 
has the gamepad's focus.

-Rick-

On 2013-05-14 15:08, Bill Spitzak wrote:
> I feel the underlying function should be this:
>
> 1. The game can enumerate all the gamepads.
>
> 2. The game can "grab the focus" for any gamepads it wants.
>
> Once it is grabbed, the pointer motion makes NO difference, removing a
> lot of the questions people are asking here. If the device was moving
> the pointer, it stops moving the pointer. If another device like a mouse
> moves the pointer, it continues to do so, but it does not matter if the
> mouse is moved outside the game and clicked elsewhere: the mouse works
> like normal sending clicks to that other client, and the gamepad events
> continue going to the game.
>
> The only complexity is to prevent clients from grabbing the gamepad when
> they should not. For this the "grab the focus" does not work unless the
> shell allows it to.
>
> As I see it the gamepad is "attached" to at most one "pointer". The
> gamepad can be grabbed if the client has that pointer's focus. The
> gamepad can also be "attached" to any number of other devices. It can
> also be grabbed if the event that triggered the grab request is a
> focus-in or event for a related device (this is so keyboard keys can
> cause a gamepad grab).
>
> Specifying this attachement is where the seat and hierarchy comes in.
>
> I very much agree that the seat==user idea is best. Otherwise it seems
> like seats are pretty useless, and users would have to be added to
> wayland anyway, making it more complex for no good reason. To get the
> "one seat per gamepad but they all share the same pointer" the
> parent-seat proposal seems like as easy fit. I am having a hard time
> coming up with a plausible setup that this would not cover. Grabbing a
> gamepad does not change this parenting in any way.


More information about the wayland-devel mailing list