2

I work on a project to control my PC with a remote, and a infrared receptor on an Arduino. I need to simulate keyboard input with a process on linux who will listen arduino output and simulate keyboard input. I can dev it with Python or C++, but i think python is more easy.

After many search, i found many result for... windows u_u Anyone have a library for this ? thanks

EDIT: I found that /dev/input/event3 is my keyboard. I think write in to simulate keyboard, i'm searching how do that

0

2 Answers 2

1

To insert input events into the Linux input subsystem, use the user-mode input device driver, uinput. This might help: http://thiemonge.org/getting-started-with-uinput (Note that while the tutorial references /dev/input/uinput, the correct file on my Ubuntu 12.04 PC is /dev/uinput.

Sign up to request clarification or add additional context in comments.

2 Comments

oh waw ! Thanks you ! It's just that i needed I'll try it !!
The link no longer works
1

The most generic solution is to use pseudo-terminals: you connect tttyn to the standard in and standard out of the program you want to monitor, and use pttyn to read and write to it.

Alternatively, you can create two pipes, which you connect to the standard in and standard out of the program to be monitored before doing the exec. This is much simpler, but the pipes look more like a file than a terminal to the program being monitored.

2 Comments

No, i don't want to focus a window or a process. I want to use my remote like a keyboard. I found that /dev/input/event3 is my keyboard, now i search to write in...
Have you tried telnet? (It uses pseudo-terminals under the hood, in the telnet server, but at least you don't have to worry about it.)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.