Hey that's the point, I want my wm to intercept the keystrokes :)
I use XGL/Compiz and it's the combination of keys to switch between the faces of the cube.
In fact, I have an IBM T42 laptop with HDAPS, a perlscript allow to record knock and then can be set in listen mode.
(see: http://www-128.ibm.com/developerworks/linux/library/l-knockage.html )
The listen mode allow to execute command -> I would like to write a perl script as command (ie. "sendkey.pl left" would rotate my cube left).
Well I'll try what you said but I doubt that it's working with any wm...