LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   Emulating a key press (https://www.linuxquestions.org/questions/linux-general-1/emulating-a-key-press-606487/)

simopal6 12-13-2007 05:13 AM

Emulating a key press
 
Hello!

I need a program which emulates a key press, which has to be captured by the foreground application (like virtual keyboards do).

Is this easy to implement?

I thought that it's just a matter of writing to a /dev/something file, but I'm not sure whether this can be done or whether such a device file exists.

Any help is appreciated!
Thanks!

David the H. 12-13-2007 12:53 PM

For a command-line solution, try xvkbd with the -xsendevent flag. You can set up a '-text' event to send keypress combinations.

'xvkbd -xsendevent -text "\Ca"' should send a control+a combination to the focused window.

There are also gui options such as the kde 'input actions' if you want to set up mouse gestures or custom hotkey combos, or something like that.


All times are GMT -5. The time now is 04:44 AM.