Home » Questions » Computers [ Ask a new question ]

Is there any method by which I can send random key events to an X11 application?

Is there any method by which I can send random key events to an X11 application?

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).

Asked by: Guest | Views: 292
Total answers/comments: 1
Guest [Entry]

"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."