up vote 0 down vote favorite
share [g+] share [fb]

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.

link|improve this question
feedback

1 Answer

up vote 3 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.

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

Your Answer

 
or
required, but never shown

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