Hi, I am writing a program using gtk. What the program does is monitor the keystroke the user entered and play a sound. My question is that how do I catch the key-press-event when the window is not focused? I'm planning to let my program stay in tray icon, so I wonder how I can grab any key-press-event from there. Thanks
Edit: I finally find a way to do it - The XTest extension, I found the a piece of code snippet from the program 'xmacro'. You can see my implementation here: http://github.com/Aitjcize/Qwertickle/blob/master/src/qwertickle.c
btw, it's still quite buggy, maybe someone can help me out? :)