[xmonad] KeyEvent stream manipulation

Daniel dan.in.a.bottle at gmail.com
Sat Sep 25 15:27:11 EDT 2010

On Sun, Sep 26, 2010 at 1:16 AM, Brandon S Allbery KF8NH <
allbery at ece.cmu.edu> wrote:

> Hash: SHA1
> On 9/23/10 11:27 , Daniel wrote:
> > For what I want to do I need to have exclusive access to the keyboard
> > events so that I can rewrite them. I have been experimenting a bit
> This really wants to be done in (or with the active help of) the X server.
> You might want to look at how various accessibility-related programs work.

I have figured that one in the meantime (Input Managers are another category
of apps which are similar). Unfortunately, I haven't found any pure X based
accessibility programs. Most seem to depend on D-Bus in some way. One of
those would be AT-SPI initiated by Gnome (seems to be in flux at the

> > * active grab on A reverts to passive (incl some FocusEvents &
> > KeymapNotify to inform us that B is still held)
> When A is pressed, grab the keyboard and manage key events yourself (which
> is what you want to do anyway, isn't it?) until all the keys you want to
> work with are released, at which point you drop the grab.

Good idea, didn't think about trying to promote the grab from passive to
active in-flight. I'll try that one and see what comes from it.

> You should probably look for x.org-related mailing lists.

Yep, I've already sent a mail off to the xorg list, as I figured that the
pool of people trying to do something similar is probably larger over there.

I have found two additional ways of tackling the problem. One is from an
answer on the xorg list which makes use of defining an xkb mapping with
'action' key mappings. I haven't investigated it yet, and at the moment it
requires a patch to the xserver which is in the X bugzilla.

Another option would be to add an additional layer of indirection on top.
I'm currently running the relevant Linux desktop on a VirtualBox VM.
VirtualBox attaches the GUI through an inprocess mechanism, which can be
remoted via a backwards compatible version of RDP (MS remote desktop
protocol). If I stick an additional proxy between the two parties, then I
can manipulate the keyboard events freely. Admittedly this is the last
solution I will look into, because it sounds like a lot of work, and I
cannot stay within XMonad to do the heavy lifting.

> - --
> brandon s. allbery     [linux,solaris,freebsd,perl]      allbery at kf8nh.com
> system administrator  [openafs,heimdal,too many hats]  allbery at ece.cmu.edu
> electrical and computer engineering, carnegie mellon university      KF8NH
> Version: GnuPG v2.0.10 (Darwin)
> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
> GdgAoMzqKpGIMOnVUDPnedqfKGrVSrbg
> =5Kpw
> _______________________________________________
> xmonad mailing list
> xmonad at haskell.org
> http://www.haskell.org/mailman/listinfo/xmonad
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.haskell.org/pipermail/xmonad/attachments/20100925/0d877f56/attachment.html

More information about the xmonad mailing list