Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

So I'm writing a game, and I'm getting crashes very intermittently occuring on movement. I'm trying to get a backtrace out of gdb, but it's incredibly tedious to keep bumbling around, hoping to hit the bug. I want an application that will send random keyboard events (preferably a subset chosen by me) to an X application (an SDL window in this case).

I tried googling and searching SuperUser, but if such an application exists (as I am sure there is) the keywords I'm using aren't hitting it.

Thanks in advance.

share|improve this question

2 Answers 2

up vote 4 down vote accepted

What you're looking for is xdotool. It's a simple command-line program that can send various events (including key-presses) to X11.

Simply write a little script in the language of your choice to call

xdotool key [key to press]

You can also do separate keydown and keyup events, so you can simulate a user holding down a key.

share|improve this answer
    
Perfect! Thank you, kind sir. –  Bernard Sep 25 '09 at 19:46

xwit is another scripting tool that allows sending / setting various X11 events. xwininfo is useful for gathering information (such as what window you're specifically interested in), and xmctrl allows scripting some X window manager actions as well.

share|improve this answer

Your Answer

 
discard

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.