From: Richard Purdie <rpurdie@rpsys.net>
To: Loye Young <loyeyoung@iycc.net>
Cc: linux-kernel@vger.kernel.org
Subject: Re: The Input Layer and the Serial Port
Date: Thu, 28 Dec 2006 16:13:54 +0000 [thread overview]
Message-ID: <1167322434.5596.49.camel@localhost.localdomain> (raw)
In-Reply-To: <20061227195433.872F03FC063@hamlet.sw.biz.rr.com>
On Wed, 2006-12-27 at 13:54 -0600, Loye Young wrote:
> I, a humble pilgrim in the Land of Tux, have spent over a year seeking
> a simple answer to what seems to me a simple question: How do I expose
> my RS232 barcode scanner to the input layer so that the scanned
> information shows up in applications? Basically, I need the scanner to
> act like another keyboard. Scan a code, see the numbers.
I can give you some hints but it will involve writing a program. It can
all be done in userspace though, saving any pain of messing with the
kernel internally/kernel recompiling.
The kernel has a driver called uinput which lets you inject input events
into the kernel from a userspace piece of code. You can write a program
to read data from /dev/ttyS0 (at 9600bps) and pass it to this uinput
driver. That should then do exactly what you need.
Working out for to use uinput caused me a few headaches but I can point
you at some example code:
http://svn.o-hand.com/view/misc/trunk/zaurusd/apps/tskeys/tskeys.c?rev=59&view=markup
This code adds support for offscreen soft "buttons" on a touchscreen. It
passes the key events to the kernel via uinput.
Cheers,
Richard
next prev parent reply other threads:[~2006-12-28 16:15 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-12-27 19:54 The Input Layer and the Serial Port Loye Young
2006-12-27 21:10 ` James Simmons
2006-12-28 16:13 ` Richard Purdie [this message]
2006-12-30 15:05 ` Petr Stetiar
2007-01-02 11:38 ` David Greaves
-- strict thread matches above, loose matches on Subject: below --
2006-12-27 23:54 Loye Young
2006-12-28 13:51 ` Matthias Schniedermeyer
2007-06-06 11:19 Lars K.W. Gohlke
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1167322434.5596.49.camel@localhost.localdomain \
--to=rpurdie@rpsys.net \
--cc=linux-kernel@vger.kernel.org \
--cc=loyeyoung@iycc.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox