Re: The Input Layer and the Serial Port

From: Matthias Schniedermeyer
Date: Thu Dec 28 2006 - 08:52:19 EST

Loye Young wrote:
>>Take for example the AT keyboard which is
>>one of the most common keyboards in the world. I have seen and
>>used it attached to a PC via parport, serial port and the standard
>>PS/2 port. So to handle cases like this the input layer created a
>>serio interface.
> If plain ASCII text is coming in the serial port, would the kernel know or even care what device was generating the characters? Could I just use whatever interface you did?

A problem at this point may be that a AT-keyboard doesn't spit out ASCII
but Scan-Codes, so a serial device spitting out ASCII would have to be
put into the loop AFTER the stage that makes conversions, or you would
have to convert ASCII back to Scan-Codes before.

Btw. I'm not normaly into barcode-scanning, but for something at work i
tried a USB-scanner (From Symbol AFAIR) to see what is stored in the
barcodes that are on the prints that i have to generate. The scanner
just registered as a plain HID-device, which resulted in the data
comming as key-presses. It was just "Plug & Play", i didn't need any
software or anything else. I just plugged the device in, opened a
text-editor to catch the data, then i scanned the bar-codes and was
happy. :-)

So if you aren't nailed to a serial scanner, you just may try a USB-scanner.

>>I recommend you take a look at sermouse.c
>>in the drivers/input.mouse directory
>>for a guide.
> I looked, but the source code I have (2.6.17, Debian) doesn't have anything called sermouse.c in the /drivers/input directory.

# find /usr/src/linux-2.6.19 -name "*sermouse*"

Bis denn

Real Programmers consider "what you see is what you get" to be just as
bad a concept in Text Editors as it is in women. No, the Real Programmer
wants a "you asked for it, you got it" text editor -- complicated,
cryptic, powerful, unforgiving, dangerous.

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at
Please read the FAQ at