Re: Trap Keys in XOrg

On 17 Jul 2006 12:18:32 -0700, kc0bfv@xxxxxxxxx staggered into the Black
Sun and said:
I'm wondering if it's possible to get XOrg to trap key presses similar
to how it traps Ctrl+Alt+Backspace.

Lots of stuff is possible. A better question is usually "Is this
practical with a reasonable amount of effort?"

I want to be able to press the multimedia keys on my laptop while
xscreensaver is active and have them actually control the music
player. While xscreensaver is active, they get trapped [and
xscreensaver stops drawing pictures]. I suppose the other option is
to have xscreensaver act on the keys.

That'd probably be a better and easier option. Xorg is a really complex
thing, and even though they've cleaned it up a bit with the new modular
Xorg, it's still a pain to find stuff and change stuff. Find the bit in
xscreensaver where it reacts to KeyPress events, put in some special
cases for the KeySyms (or keycodes) you want it to ignore? I don't know
whether you'll have to modify the procInterrupts X resource as well.
("man xscreensaver" talks about that resource, and why it might get used

Hmm... it may be worth sending the patches to JWZ once you've got
something that's working reasonably well and reads a list of KeySyms or
keycodes to ignore from a file. I'm sure there are people who would
find this feature a useful thing. HTH anyway,

Matt G|There is no Darkness in Eternity/But only Light too dim for us to see
Brainbench MVP for Linux Admin / mail: TRAP + SPAN don't belong / "He is a rhythmic movement of the
-----------------------------/ penguins, is Tux." --MegaHAL