Tell me more ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

For example is there a Linux command or way that I could from a program (c++ | python| or other) enter a series of keyboard inputs that are interpreted as though they are keyboard inputs.

I have a bad case of Repetitive Stress Injury (RSI) from typing. To ease my pain I developed a voice controlled interface using pocket sphinx and a custom grammar and to run a number of very common commands. ex: "open chrome" , "open vim".

Basically what is shown here, but with slightly diff tools:

http://bloc.eurion.net/archives/2008/writing-a-command-and-control-application-with-voice-recognition/

I have run into some limitation as I can only execute command line commands given a voice command. Rather than having a "voice command" -> "command line command" mapping, I would like to have "voice command" -> "keyboard input" mapping. So when my active window is a browser and I type + n, and new tab opens. If I'm in vim and new vim tab opens.

Any suggestions, ideas, tools or approaches to this problem would be much appreciated. I understand the answer may not be simple, but would like to develop it none the less.

share|improve this question

closed as off topic by Blrfl, Walter, gnat, Matthieu, Ryathal Oct 31 '12 at 18:33

Questions on Programmers Stack Exchange are expected to relate to software development within the scope defined in the FAQ. Consider editing the question or leaving comments for improvement if you believe the question can be reworded to fit within the scope. Read more about closed questions here.

2 Answers

Yes, this is possible with the uinput driver. See this page which describes how to use it. Note that your kernel must be compiled with CONFIG_INPUT_UINPUT support.

share|improve this answer

It's relatively easy to create X keyboard events, which should suffice for your purpose.

You can download a program that does exactly this from my website:

http://members.chello.at/~erich.kitzmueller/ammoq/down/xjoypad.zip

share|improve this answer

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