Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the difference between /dev/uinput and /dev/input in Linux?

Tags:

linux

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?

like image 330
Tom Xue Avatar asked Sep 18 '12 13:09

Tom Xue


2 Answers

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."

like image 93
Tom Xue Avatar answered Sep 28 '22 07:09

Tom Xue


/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
like image 38
Piotr Wadas Avatar answered Sep 28 '22 05:09

Piotr Wadas