Is it possible to execute keyboard input programmatically in Linux?
Posted
by
Taylor Hawkes
on Programmers
See other posts from Programmers
or by Taylor Hawkes
Published on 2012-09-29T16:46:09Z
Indexed on
2012/10/01
9:49 UTC
Read the original article
Hit count: 356
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:
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.
© Programmers or respective owner