How to setup linux input subsystem and event devices


Copyright © 2002 Andrey Volkov
Revision date 11/30/2002. You can always get the latest version from mkeys.sourceforge.net


First of all, you need some kernel modules to be loaded or compiled in:

input.o - Input core (main driver)
mousedev.o - If you need mouse support
keybdev.o - If you need keyboard support (most likely you do)
usbcore.o - For USB to work
usb-[uoe]hci.o - USB host controller (either one: UHCI, OHCI, or the newest EHCI)
hid.o - The HID driver handles all HID devices

In case you already work with USB mouse or/and keyboard, you might have this modules installed. But you may also use BIOS support for USB keyboard, in this case change to linux USB keyboard support by these modules.

Then, another module is needed for HIDNode driver to work (since it uses event interface):

	evdev.o

When you load or compile in modules, you should create device files (unless you have a devfs, you should):

cd /dev
mkdir input
mknod input/mice c 13 63 # this is for USB mouse, if you own one

mknod input/mouse0 c 13 32 # those are for applications that require
mknod input/mouse1 c 13 33 # PS/2 - style mouse device
mknod input/mouse2 c 13 34
mknod input/mouse3 c 13 35 
...
mknod input/mouse30 c 13 62 

mknod input/event0 c 13 64 # this is for event devices required by HIDNode
mknod input/event1 c 13 65 
mknod input/event2 c 13 66
mknod input/event3 c 13 67

Note: LEDNode module requires a right to write to event files (to light a LED we need to write to file, not read :). So, if you need this, check that you have enough permissions to write to /dev/input/event?

Now everything should be right, but if you encounter some difficulties, contact me.


SourceForge.net Logo