WM suport for grab key scrolling

Jim Gettys jg at laptop.org
Thu Apr 19 09:12:47 EDT 2007


On Thu, 2007-04-19 at 14:31 +0200, Marco Pesenti Gritti wrote:
> Hi Matthew,
> 
> we have a grab key on the OLPC keyboard. When it's pressed we should
> grab the pointer and mouse movements should cause the main view on the
> currently active window to scroll (the web page for a browser, the
> document for a word processor etc).
> 
> Zephaniah was suggesting the WM should manage this which sounds like a
> sensible approach to me. Basically when pressing the grab key the WM
> would:
> 
> 1 Grab the pointer, hide it and ensure it's always at the center of the
> screen (otherwise when you get on the edges you would not be able to
> scroll in that direction anymore)

I think the best you can do is warp the pointer back to the original
location when you are done.

> 2 Ask the active window to scroll of a certain amount of pixels on x,y
> axis.
> 
> What do you think? Is there a clean way for the WM to communicate 2 to
> the active window?

Yes, this is what XAllowEvents with ReplayPointer is for: you can have a
WM get an event, process it, and then replay it to an underlying
application.  Samething goes for keyboard events.  It is possible to
grab events, process them in a WM, and then also allow the same events
to be delivered to underlying applications.
                                       - Jim

-- 
Jim Gettys
One Laptop Per Child





More information about the Devel mailing list