9

I can see that both /dev/uinput and /dev/input exist in my Ubuntu and they are similiar. They can be used to detect/simulate the key/mouse/touch event. So I am confused of what the difference is between them? Thanks!

New added: Yes, I know that /dev/input is a directory and it contains like event0~6, and some of them is key/mouse/touch or other thing. I still want to know why uinput and input/eventX exsit together. Why and is there any difference?

Tom Xue
  • 3,169
  • 7
  • 40
  • 77
  • 6
    The question should be on superuser. – m4tx Sep 18 '12 at 14:01
  • This is for programming purpose. I don't know which one is proper to use and want to understand their difference. – Tom Xue Sep 18 '12 at 14:33
  • It may be for programming purpose. But the question absolutely doesn't connect with programming :) The question is directly related with the operating systems, not with programming. Stack overflow == programming; super user == operating system-related stuff :) – m4tx Sep 18 '12 at 14:36
  • OK, thanks for detailed explaination. For me, answer is more important :) – Tom Xue Sep 18 '12 at 14:41

2 Answers2

16

I find the answer here: http://thiemonge.org/getting-started-with-uinput As it says: "uinput is a linux kernel module that allows to handle the input subsystem from user land. It can be used to create and to handle input devices from an application. It creates a character device in /dev/input directory. The device is a virtual interface, it doesn't belong to a physical device."

Tom Xue
  • 3,169
  • 7
  • 40
  • 77
  • 1
    Link fails, can be googled, but an [example](https://stackoverflow.com/questions/40676172/how-to-generate-key-strokes-events-with-the-input-subsystem) is better anyway. – Roland Puntaier Feb 11 '21 at 14:02
5

/dev/uinput probably stands for "user input". On mine, /dev/input is a directory, containing event catchers

pwadas@vao:~$ ls -al /dev/uinput /dev/input/ | sed -e 's/^/    /g'

crw------T 1 root root 10, 223 wrz 18 07:09 /dev/uinput

/dev/input/:
total 0
drwxr-xr-x  4 root root    460 wrz 18 07:09 .
drwxr-xr-x 14 root root   3660 wrz 18 07:09 ..
drwxr-xr-x  2 root root    120 wrz 18 07:09 by-id
drwxr-xr-x  2 root root    160 wrz 18 07:09 by-path
crw-------  1 root root 13, 64 wrz 18 07:09 event0
crw-------  1 root root 13, 65 wrz 18 07:09 event1
crw-------  1 root root 13, 74 wrz 18 07:09 event10
crw-------  1 root root 13, 75 wrz 18 07:09 event11
crw-------  1 root root 13, 76 wrz 18 07:09 event12
crw-------  1 root root 13, 77 wrz 18 07:09 event13
crw-------  1 root root 13, 78 wrz 18 07:09 event14
crw-------  1 root root 13, 79 wrz 18 07:09 event15
crw-------  1 root root 13, 80 wrz 18 07:09 event16
crw-------  1 root root 13, 66 wrz 18 07:09 event2
crw-------  1 root root 13, 67 wrz 18 07:09 event3
crw-------  1 root root 13, 68 wrz 18 07:09 event4
crw-------  1 root root 13, 69 wrz 18 07:09 event5
crw-------  1 root root 13, 70 wrz 18 07:09 event6
crw-------  1 root root 13, 71 wrz 18 07:09 event7
crw-------  1 root root 13, 72 wrz 18 07:09 event8
crw-------  1 root root 13, 73 wrz 18 07:09 event9
crw-------  1 root root 13, 63 wrz 18 07:09 mice
crw-------  1 root root 13, 32 wrz 18 07:09 mouse0
pevik
  • 4,523
  • 3
  • 33
  • 44
Piotr Wadas
  • 1,838
  • 1
  • 10
  • 13