[comp.os.msdos.programmer] What are Scancode sets?

rlim@hpspcoi.HP.COM (Ruth Lim) (09/26/90)

Hello!

This is my first posting, so please forgive any mistakes.

I was reading through my PC manual  (Boy, isn't that a first :-) ) and
read about how there are different scancode sets available.  According
to my manual, it says that there are three sets,  Scancode set 1 (XT/PC
scancode), scancode set 2 (AT scancode, default), and scancode set 3 (??).

Does anyone know why there are different scancode sets and if there are
programs or accessories that use anything besides the default scancode set?
If DOS uses the PC scancode (which I think it does), why have all these
other scancode sets?  Anyway, how does this all work?

I'd be happy with just about any thoughts or insights into the matter.

Thanks!

Ruth
rlim@hpspcoi.hp.com

PS  If anyone sounds interested, I'd be happy to share what I find out!

rlim@hpspcoi.HP.COM (Ruth Lim) (10/04/90)

A while earlier, I posted a question regarding the keyboard scancode
sets.  I received an explanation which I thought was really good.
The answer I received follows in part.  Once again, I would like to thank
Robert A. Lerche for his great answer.


"I take it you are referring to scan codes as generated by the keyboard.
This is a somewhat involved story.

"The original PC keyboard has 83 keys.  The scan codes it generates go from
01H to 53H for make (as I recall), with the high order bit on for break
(each key generates a separate code for make (press down) and break (release)).

"The 84-key AT keyboard generates a completely different set of scan codes
and uses a special prefix (0F0H) to indicate break.  On the AT motherboard
there's a processor which translates the AT keyboard's codes into the
original codes generated by the old PC keyboard.  This translation can
be disabled by sending the appropriate command to the processor (it's at
port 64H if I recall correctly -- I don't have the manual handy).

"The 101/102 key "extended" keyboards generate yet another set of scan codes.
In their normal mode they more-or-less emulate the 84-key AT keyboard
(plus adding special 0E0H escape codes to distinguish the cursor pad
keys from the numeric pad/cursor keys).  In _their_ native mode they emit
a completely different set of codes.  I don't know of any application
that uses the native scan codes of the 101-key keyboard.

"The 84-key and 101/102-key keyboards can accept commands from the system
unit to control the lights, typeamatic rate, etc.  The original PC keyboard
was input only."