the OLPC XO grab button (triggering mouse scrolling using a keypress)

Peter Hutterer peter.hutterer at who-t.net
Mon Jun 30 23:22:09 PDT 2008


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



More information about the xorg mailing list