nanogui@linuxhacker.org

nanogui@linuxhacker.org


Subject: Re: [nanogui] Keyboard driver
From: Greg Haerr
Date: Fri, 7 Jun 2002 14:39:12 -0700

> I want to implement a keyboard driver for nanox running on uClinux, but my
> input device is not associated with any device driver in uClinux. The open
> method of the keyboard driver supposed to return a file descriptor that is
> then used in a select to get the events, so i'm in trouble.
>
> Is there a way to make it work without implementing a kernel device driver
?

You can make it work either by waiting in select() or something
that will return when either a kbd or mouse event occurs, or
by polling.  In either case, hack MwSelect() in nanox/srvmain.c
or mwin/winmain.c to get your keyboard input.

What won't work is waiting in a select for your mouse input,
and somehow getting your keyboard input through another
method.  When you press a key, the select won't return.  So
you'll have to devise another method.  The MSDOS version,
for instance, continually polls both kbd and mouse. (that's
what the kbd_poll entry point is for, usually unused in Linux)

Regards,

Greg


nanogui@linuxhacker.org