Serial input device to kernel input

From ArchWiki
Revision as of 12:09, 20 July 2008 by Markzzzsmith (talk | contribs) (New page: Category:Input devices (English) Category:HOWTOs (English) =Introduction= Although USB is now probably the most popular way to connect input devices such as mice, serial input devi...)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search


Although USB is now probably the most popular way to connect input devices such as mice, serial input devices, such as older mice, and more exotic input devices such as 3Dconnexion Spaceballs are still quite usable, either with a serial port built into the computer, or via a USB to serial converter dongle.

The traditional way to support these serially attached devices was to configure each application with the details such as which serial port the input device was attached to, and what protocol the device used. As the most common application people used with a serial device was / XFree86, this wasn't too much of a problem. However, if you wanted to use the gpm utility to have mouse control at the console, as well as using / XFree86, you may encounter limitations as to which input protocol each application supported.

A better approach is to have the Linux kernel input subsystem manage the serially attached device, and then present the input signals the device generates in the same way that USB and PS/2 input device signals are presented, via the /dev/input/{mice|mouseX} device files.

This guide describes the simple steps necessary to "attach" a serial input device to the Linux kernel input subsystem.


Firstly, you'll need to install the inputattach utility. This utility tells the kernel input subsystem which serial port the input device is attached to, and what type of device is attached to the specified serial port. An AUR package for the utility is here, or you can search AUR for a package named inputattach.

Once you have compiled and installed the AUR package, you can view the inputattach help, to see the large list of serial input devices the Linux kernel input subsystem supports. Here is an example of the help output:

$ inputattach --help

Usage: inputattach [--daemon] <mode> <device>

  --sunkbd         -skb      Sun Type 4 and Type 5 keyboards
  --lkkbd          -lk       DEC LK201 / LK401 keyboards
  --vsxxx-aa       -vs       DEC VSXXX-AA / VSXXX-GA mouse and VSXXX-A tablet
  --spaceorb       -orb      SpaceOrb 360 / SpaceBall Avenger
  --spaceball      -sbl      SpaceBall 2003 / 3003 / 4000 FLX
  --magellan       -mag      Magellan / SpaceMouse
  --warrior        -war      WingMan Warrior
  --stinger        -sting    Gravis Stinger
  --mousesystems   -msc      3-button Mouse Systems mouse
  --sunmouse       -sun      3-button Sun mouse
  --microsoft      -bare     2-button Microsoft mouse
  --mshack         -ms       3-button mouse in Microsoft mode
  --mouseman       -mman     3-button Logitech / Genius mouse
  --intellimouse   -ms3      Microsoft IntelliMouse
  --mmwheel        -mmw      Logitech mouse with 4-5 buttons or a wheel
  --iforce         -ifor     I-Force joystick or wheel
  --newtonkbd      -newt     Newton keyboard
  --h3600ts        -ipaq     Ipaq h3600 touchscreen
  --stowawaykbd    -ipaqkbd  Stowaway keyboard
  --ps2serkbd      -ps2ser   PS/2 via serial keyboard
  --twiddler       -twid     Handykey Twiddler chording keyboard
  --twiddler-joy   -twidjoy  Handykey Twiddler used as a joystick
  --elotouch       -elo      ELO touchscreen, 10-byte mode
  --elo4002        -elo6b    ELO touchscreen, 6-byte mode
  --elo271-140     -elo4b    ELO touchscreen, 4-byte mode
  --elo261-280     -elo3b    ELO Touchscreen, 3-byte mode
  --mtouch         -mtouch   MicroTouch (3M) touchscreen
  --touchright     -tr       Touchright serial touchscreen
  --touchwin       -tw       Touchwindow serial touchscreen
  --penmount       -pm       Penmount touchscreen
  --fujitsu        -fjt      Fujitsu serial touchscreen
  --dump           -dump     Just enable device


For example, if you have a Logitech Trackman Marble serial mouse, as I do, the device type you would specify would be either --mouseman or -mman.

The inputattach utility needs to run continuously. In additon to installing the inputattach utility, the AUR package above installs a /etc/rc.d/inputattach script that can be added to the DAEMONS option of /etc/rc.conf, making it automatically start at boot time. A configuration file for inputattach is installed as /etc/conf.d/inputattach.conf.