[sugar] [peter.hutterer at who-t.net: Re: the OLPC XO grab button (triggering mouse scrolling using a keypress)]

Erik Garrison erik at laptop.org
Wed Jul 2 09:59:30 EDT 2008


Advice about how to implement the grab button functionality from the
xorg dev list.

----- Forwarded message from Peter Hutterer <peter.hutterer at who-t.net> -----

Date: Tue, 1 Jul 2008 15:52:09 +0930
From: Peter Hutterer <peter.hutterer at who-t.net>
To: Erik Garrison <erik at laptop.org>
Cc: xorg at lists.freedesktop.org
Subject: Re: the OLPC XO grab button (triggering mouse scrolling using a
	keypress)

On Mon, Jun 30, 2008 at 07:35:16PM -0400, Erik Garrison wrote:
> The keyboard has two buttons which are marked with a hand.  The
> interested may see a schematic at
> http://wiki.laptop.org/go/OLPC_Keyboard_layouts.  It was intended at
> design time that pressing either of these buttons (Super_L and Super_R)
> and simultaneously moving the mouse would trigger x and y scrolling in
> X11 applications.
> 
> I'm curious if anyone knows of ways in which similar functionality has
> been implemented elsewhere.  In general I'd like some advice about the
> best place to implement this feature.

Just put a passive grab on the keys to receive the key press event and then,
depending on what you mean by scrolling:
- mouse wheel emulation
  put a (sync) grab on the mouse and use XTestFakeButtonEvent on buttons
  4/5/6/7 for to scroll. you'll need to mess around a bit with XAllowEvents,
  but it should work.
- viewport scrolling
  XWarpPointer seems the only way, I don't see any other callers for
  xf86SetViewport that could be used directly.

Cheers,
  Peter

----- End forwarded message -----


More information about the Sugar mailing list