> I was under the impression that the kernel would/should at least always see 
> the raw scancode (where this is not a value between 0 and 255), whether or 
> not it could do something with it, and that X didn't use linux's keyboard 
> driver anyway, it interpreted the scancodes itself.

You are mixing the linux keyboard driver and the raw keycodes emulator.
The 'traditional' (without USB) keyboard driver does some steps:
- reads raw scan-codes from a hardware keyboard,
- converts two-byte scan-codes to one-byte 'middle raw' keycodes (this mapping
  can be changed using setkeycodes)
- maps keycodes to symbols (characters)
There are some 'forks' from those steps and any application can request what
data (from what step) it wants.  The keyboard driver can give out codes
from any of steps mentioned above:
- raw scan-codes (that the driver has read from tha hardware)
- middle raw keycodes
- characters.
The Xserver usually requests codes from lowest level, i.e. raw scan-codes
(although it can also use middle raw keycodes).  In this case we can say that
the Xserver doesn't use linux's keyboard driver because all next steps of
the linux's driver don't work there.  But note that even in this case 
the Xserver doesn't read scan-codes from the hardware directly.  Anyway it
reads the data from linux's driver but actually uses only small part of this
driver.
              |********  linux's keyboard driver *************************|
keyboard ---->reading, scan- to key- codes conv., keycodes to symbols conv.
                        \
                         \-->  X's keyboard driver

Since an USB keyboard produces another scan codes (and uses a different
protocol) its codes can't be read by PC keyboard driver directly.  Therefore
there is special sub-driver that reads USB codes from the USB keyboard and
converts them to PC's scan-codes and passes those codes to the PC keyborad
driver as if they were read from the PC keyboard.

                                  |*** linux's keyboard driver ****** ...
                  PC keyboard ---->reading, scan- to key- codes conv., ...
                                          /  \
         |******* sub-driver *********|  /    \-->  X's keyboard driver
USB kbd-->reading, PC's scan-codes emul./

In this case X's keyboard driver anyway interracts with linux's driver and
if the USB sub-driver doesn't emulates PC's raw scan-codes (with a warning
or silently) for some keys, it passes nothing to PC's driver and the X's
driver gets nothing too.

Is it clear?
-- 
 Ivan U. Pascal         |   e-mail: [EMAIL PROTECTED]
   Administrator of     |   Tomsk State University
     University Network |       Tomsk, Russia
_______________________________________________
Devel mailing list
[EMAIL PROTECTED]
http://XFree86.Org/mailman/listinfo/devel

Reply via email to