PDA

View Full Version : Linux tty keyboard driver...


twgray
24-02-2006, 05:09 AM
I have written a driver to read an external switch array. I need to
insert these key presses as standard key codes into the tty keyboard
buffer. Can someone explain how to do this?

Marco Cavallini
24-02-2006, 06:48 AM
twgray ha scritto:
> I have written a driver to read an external switch array. I need to
> insert these key presses as standard key codes into the tty keyboard
> buffer. Can someone explain how to do this?
>

Hi Terry,
how are you ?

You can take a look at this keyboard driver.
http://www.koansoftware.com/it/art.php?art=37

HTH
--
Marco Cavallini
Koan s.a.s. - Bergamo - ITALIA
Embedded and Real-Time Software Engineering
www.koansoftware.com | www.klinux.org

Wil Taphoorn
25-02-2006, 12:31 AM
twgray wrote:

> I have written a driver to read an external switch array. I need to
> insert these key presses as standard key codes into the tty keyboard
> buffer. Can someone explain how to do this?

You could translate the key presses into corresponding PS/2 (scan code
set 1) bytes and pass them to handle_scancode() which is part of your
normal keyboard handler.

--
Wil

Captain Dondo
02-03-2006, 02:59 AM
On Thu, 23 Feb 2006 07:09:26 -0800, twgray wrote:

> I have written a driver to read an external switch array. I need to
> insert these key presses as standard key codes into the tty keyboard
> buffer. Can someone explain how to do this?

google for kbde and kbdd

kbde uses a kernel module to inject keypresses into handle_scancode as
someone suggested; kbdd uses /dev/uinput so no kernel module is needed.

--Yan

--
o__
,>/'_ o__
(_)\(_) ,>/'_ o__
Yan Seiner, PE (_)\(_) ,>/'_ o__
Certified Personal Trainer (_)\(_) ,>/'_ o__
Licensed Professional Engineer (_)\(_) ,>/'_
Who says engineers have to be pencil necked geeks? (_)\(_)