Questions about the Linux console keyboard driver / translation tables
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) 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, are these values read differently then written?
E.g. would I only type 0xfb61 when using the KDSKBENT ioctl?
I hope anyone can help me out a little,
thank you very much in advance,
regards,
Bill
The first thing we need to see what is going on, please post the output of
from the console. This affects what you're talking about in a big way. "unicode" may be one of several things, so we are all on the same code page.
The first thing we need to see what is going on, please post the output of
from the console. This affects what you're talking about in a big way. "unicode" may be one of several things, so we are all on the same code page.
Hm, I am talking about kernel system calls, I didn't think the locale is involved here.
With "unicode" I mean one of the 4 states for the console after
which are:
You can set these with the
Unicode just means that the kernel console driver will handle characters as two bytes long (unsigned short).
The values I am talking about I acquired through the KDGKBENT ioctl, like this:
If you compile this program and invoke it with the first parameter as one of the above mentioned 256 keymap tables, and the second parameter as your keycode, it will print the corresponding value.
You can use showkey(1) to get a keycode from your keyboard (it doesn't work while in X I assume)
E.g. When I press 'a' during showkey(1) I get the keycode 40, if I then invoke my program like
I get
Where 0061 would be the utf-8 (and ascii) representation of 'a', if I use 1 instead of 0 I get 0b41, where 0041 would be capital letter 'A'
This should all be independent of the locale, it depends on the defined keymap(5)
Now I am wondering what the 0x0b is doing there, it could be the KT_LOCK function (defined in linux/keyboard.h), but then I am wondering why it is not 0xfb, because functions need to be greater than 0xf000, or so I thought.
I hope you are seeing where I am getting at, my in- and output on the console is jut fine, I am only wondering about the internals.
Regarding this, this is the most interesting link I have found so far: (The part I am interested in starts at section: "Key maps in the kernel")
h**p://gunnarwrobel.de/wiki/Linux-and-the-keyboard.html
But for what it's worth, here my locale output:
regards.
Hi,
i'm using a debian-4.0r1 on an old subnet machine.
I have to extend it with an other keyboard .
What i have is a DVD of etch 4.0r7.
How can i install and load the keyboard-driver for the us-keyboard?
Can anybody please give me a hint how to do that?
Thanks in advance (0 Replies)
Ran into this issue today and wanted to share how I fixed it as there is not a lot a lot of info online on this issue.
We upgraded our NetApp controllers to Ontap 9 and reboot all our iSCSI attached LDOMs after. One of the LDOM did not come up cleanly and it would not accept any keyboard inputs... (0 Replies)
Hi all,
I'm installing a HP r2660 machine with HP-UX 11.23 (this version fixed by customer's product) and I've troubles using the VGA console as workstation display.
At first it worked just as TEXT console, then I fixed /etc/dt/config/Xservers and now I've the CDE prompt for login.
... (5 Replies)
(USING FEDORA 16)
I am using following command:
cat `pwd`/pci-0000:00:1d.0-usb-0:1.3:1.0-event-kbd
to access the keyboard driver to make a key logger ,but what i am getting is just some hash code ,please help me decrypt it.
Thanks. (1 Reply)
:confused:Hi
This was installed on the Linux box a few weeks back by a guy that no longer works for us. All worked fine until last week. Now when we connect its just a blank screen with no icons.
I get a whole bunch of errors when starting the service too:
Tue Feb 23 14:29:45 2010
... (1 Reply)
How to write a keyboard driver with interrupt driven? the platform is ARM and the interface is SRAMC with I/O mapped. What should my handler and read fucntions contains? and I want to know how to map the memory by using the ioremap() function? when exactly we have to use mmap()can you please help... (0 Replies)
hai friend,
I am new to Linux, i need a book for Linux basic and Linux device driver ..
plz send the book name and author(Easy to learn and mostly used by programmers) and also send the link if it is available in Net...
Thank you.
... (0 Replies)
Well, i have a little problem here.
I am given device "console" of symbolical type.
I do need to get its driver's number (index ?)
Your help would be greatly appreciated
thx,
axujet (1 Reply)
I recently tried to install Linux 7.2 on my home PC (Compaq), and it did not recognise my keyboard. I could not proceed with the installation as I could not type anything. I installed 6.2 and it worked fine???????????. I was wondering if anybody has encountered this problem (very frustrating).
... (4 Replies)