Game Development Stack Exchange is a question and answer site for professional and independent game developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm developing an app under C++ and SDL running in Ubuntu. I'm using the SDL events to handle the keypad buttons. My problem is that my app launch other programs and it should close they with a key combination, but I can't detect the user presing buttons outside of my app.

¿How could I do this?

share|improve this question
up vote 3 down vote accepted

XGrabKey if you're using an x environment (you probably are, unless you know otherwise)

share|improve this answer
Thank you. that's exactly what I was looking for. – amusero Dec 1 '12 at 18:35

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.