Scan-codes

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
Whodoo

Scan-codes

Post by Whodoo »

After a long time and lots and lots of topics, I got the keyboard interrupt working ;D But how do I convert the scancode? Also I read that ESC has the scancode 1, but when I print the scancode of a key that I press, ESC shows 68..
User avatar
Brendan
Member
Member
Posts: 8561
Joined: Sat Jan 15, 2005 12:00 am
Location: At his keyboard!
Contact:

Re:Scan-codes

Post by Brendan »

Hi,

There's 2 different sets of scan codes. The first one is normally used when the keyboard sends data to the keyboard controller chip. The keyboard controller chip usually converts this into a second (XT compatible) scan set before the keyboard driver reads it.

Therefore, you should be getting these scan codes (with XT compatible tanslation):
http://panda.cs.ndsu.nodak.edu/%7Eachap ... odes1.html

With these scan codes 68 (0x44) is the 'F10' key, and ESCAPE would be 1 (0x01).

If you turn the XT translation off you would get these scan codes instead:
http://panda.cs.ndsu.nodak.edu/%7Eachap ... odes2.html

With these scan codes 68 (0x44) is the letter 'O' key, and ESCAPE would be 118 (0x76).


Cheers,

Brendan
For all things; perfection is, and will always remain, impossible to achieve in practice. However; by striving for perfection we create things that are as perfect as practically possible. Let the pursuit of perfection be our guide.
WhoDoo

Re:Scan-codes

Post by WhoDoo »

Thanks you.. what is the Make and Break tables? The make I understand but the break?
User avatar
Solar
Member
Member
Posts: 7615
Joined: Thu Nov 16, 2006 12:01 pm
Location: Germany
Contact:

Re:Scan-codes

Post by Solar »

You mean, you didn't understand the tables at
http://panda.cs.ndsu.nodak.edu/~achapwe ... odes1.html ?

Well, you could have tried
http://panda.cs.ndsu.nodak.edu/~achapwe ... board.html (which is conveniently linked at the bottom of the former page under "related information") to find this:
There are two different types of scan codes: "make codes" and "break codes". A make code is sent when a key is pressed or held down. A break code is sent when a key is released.
:) <= meaning, no offense intended, try to take the morale for future web research. ;)
Every good solution is obvious once you've found it.
Whodoo

Re:Scan-codes

Post by Whodoo »

hee-hee thank you.. :)
Post Reply