I'm trying to inject keystrokes into the input daemon so as to simulate typing from a Bash script. Is this possible, and if so, how can I make it happen?
|
|
If you are operating at the X level (as in Gilles' question), then use xdotool like so:
Where KEYSTROKE_SPECIFIER can be something like "a" or "F2" or "control+j" EDIT: I missed your response to Gilles' question, sorry. I'll leave this response here as a solution for the X-case. |
|||||||
|
|
Use the
More complete references: |
|||
|
|
|
I wrote some Python code that does that. You can find it in my open source project. http://code.google.com/p/pycopia/source/browse/trunk/core/pycopia/OS/Linux/event.py If you run that module as a script as root you can see a demo in action. This basic functionality was extended for another project, powerdroid, that provides more concrete implementation for an embedded system (Android). http://code.google.com/p/powerdroid/source/browse/trunk/src/droid/devices.py |
|||
|
|
|
If you're NOT working with X programs with windows that can be sent keys, you are probably looking for |
|||
|
|
