Subject: Re: What is a keysym, scan code, etc?
To: None <current-users@NetBSD.ORG>
From: der Mouse <mouse@Collatz.McRCIM.McGill.EDU>
List: current-users
Date: 06/11/1996 12:06:46
> I'm a bit confused by all the layering of keyboard interpretation.

> As I see it:

> keyboard ------> kbd/bios/firmware -------> kernel ----------> procs
>          ?code?                   scan code       ascii/signals

Mostly true for most ports, at least for ports which _have_ keyboards
as distinct from terminals.  This varies widely from port to port, and
in some cases probably within ports.

In the case of the Sun ports (which I mention simply because they're
the ones I'm familiar with), the keyboard switches are arranged in a
matrix layout for the keyboard controller.  The keyboard controller
generates up/down key events and sends them over a serial line (like
RS232 but with different signal levels and connectors) to the cpu,
where they look just like an ordinary serial line to the kernel.

> Things get more muddy (to me, anyway) when X is involved.

X simply asks the kernel to give it keyboard up/down events, then turns
them into KeyPress and KeyRelease events for clients.

> Drivers are also involved here somewhere, but I don't know if it does
> the mapping to or from scan codes.

Depends on the port.  For the sparc and sun3 ports, the driver does
little more than reformat the event, unless it's generating a character
stream from a key-event stream.

					der Mouse