Questions about the console keyboard driver / translation tables

From: finkler
Date: Sat Mar 10 2012 - 18:15:07 EST


Hi there,

I am trying to understand the logic of the Linux keyboard driver, I am not sure if this is the right place to ask, but I don't know where else I could.

Btw. I am talking about an unicode console here.

1.) The Linux kernel (currently) can take 256 translation tables (keymaps), I figured that if I have 8 Mod-Keys and I can press two at the same time, then this makes 256 possible modifications.
E.g. the value of my keycode of the button 'a' is 0x0b61 (small letter a) in table 0 and 0x0b41 (capital letter A) in table 1, so is it true that table 1 is for shift pressed keycodes?
If so, then why is shift (KG_SHIFT in linux/keyboard.h [1]) set to 0, and how do I compute the modifications, meaning how do I know what e.g. index 231 represents?

2.) As seen above, the value for 'a' is actually 0x0b61 instead of 0x0061, if b indicates a type (here KT_LOCK) why isn't it 0xfb61, because I thought that only values above 0xf000 represent typed values, and the values below are simply unicode values.
The values above are read via the KDGKBENT ioctl [2], are these values read differently then written?
E.g. would I only type 0xfb61 when using the KDSKBENT ioctl?

3.) If I wanted to assign "Return" to a keycode, what is the difference between using a simple 0x000d (13) and the KT_SPEC type with the function fn_enter (which is supposedly 0xf201)?

I hope anyone can help me out a little,
thank you very much in advance,
regards,
Finkler

1: http://tomoyo.sourceforge.jp/cgi-bin...nux/keyboard.h
2: http://www.kernel.org/doc/man-pages/...e_ioctl.4.html

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/