I currently write a small desktop app (in case you are curious http://sourceforge.net/projects/launchmenu) and for this I have to research on how to grab mouse events and eventually keyboard as well. Now I thought that this might be usefull for wine when playing games under the DirectX emulation, so I checked the sources for XGrabButton()/XGrabKey() and I couldn't find any references to it. When I tried to play Thief and Thief 2 I always had the problem that the keys are going to the shell where I started it from, instead of going into the game. I wrote a small test app for my project in order to get this feature straight and there I could capture all mouse events (haven't tried keyboard, but it should work equally well) without any interference with the remaining X system. Is this intenttionally that these functions are not used and if so what is the reason for it? Or is there a layer in between wine and X so that wine is not using Xlib API directly?
I think that using this should work at least in programs where the entire screen is taken over, like in games, probably other applications well.