12

I'm fairly new to ubuntu and I've started to search around everywhere and check everything! Recently I saw these files at /dev/input/eventX, js0, mice, mouseX. By printing the output using "cat" I realized they are somehow responsible for mouse and keyboard input but the output had an strange character encoding (even for the keyboard).

My questions are,

  1. what are these files and how can I interpret the data of these files?
  2. Are there any other places that I can access the input/output of my Ubuntu machine?
  3. And are there any ebooks, manual or something similar that I can check the duty and structure of ubuntu system files? (i.e. to find the answer of such question)

Update

To make the data of the file more readable, I used hexdump:

sudo cat /dev/input/by-id/<nameofthemouse> | hexdump -C

[Source]

Pouya
  • 463
  • For more information on the filesystem layout, see http://askubuntu.com/questions/138547/ and for documentation on the filesystem see http://askubuntu.com/questions/165677/ –  Nov 02 '12 at 15:59
  • 2
    Possibly useful links provided in a deleted answer by user31708: https://www.kernel.org/doc/Documentation/input/input.txt - https://github.com/torvalds/linux/blob/master/include/uapi/linux/input.h - https://stackoverflow.com/questions/20943322/accessing-keys-from-linux-input-device – Byte Commander May 06 '16 at 13:22

3 Answers3

6

This is the location where device files for your input devices are located.

Device Files: (taken from Wikipedia)

In Unix-like operating systems, a device file or special file is an interface for a device driver that appears in a file system as if it were an ordinary file...They allow software to interact with a device driver using standard input/output system calls, which simplifies many tasks and unifies user-space I/O mechanisms.

green
  • 14,306
6

/dev is system directory that contains all Hardware device related files. Check out this manual for Ubuntu Filesystem Tree Overview and this also.

enter image description here

KK Patel
  • 19,083
  • Thanks. But how can I interpret this data? To me they look like of bunch of strange characters. Please kindly refer to my questions again. Let's say, how can I read (if possible) the cursor location from this file? – Pouya Nov 02 '12 at 11:00
  • I have indicated that they are system files necessary for devices. You search System Moniter tool in dash for input output network stataic – KK Patel Nov 02 '12 at 11:17
2

All the information in /dev/input/eventX is stored in a structure called input_event. More details about the event are available here: https://www.kernel.org/doc/Documentation/input/input.txt

Eliah Kagan
  • 117,780
geoff
  • 21
  • 4
    it would be great if you could add some more details here rather than sending us to an external site for all the information. Could you at least summarise some key points of interest? – Zanna Aug 03 '17 at 20:53