default scan code set

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
slacker

default scan code set

Post by slacker »

i have researched the keyboard controller all over the internet and have found different info about the scan code sets. some sites say that the default set is set 1 while others say that the default is set 2. another site says that set 2 scancodes are translated to set 1 scan codes. also i have been using 0x1C to be the scan code for "enter" under set2 and it works but several sites say that enter is 0x5A under set 2....whats goin on here???
Therx

Re:default scan code set

Post by Therx »

http://my.execpc.com/~geezer/osd/kbd/index.htm#scan

[table][tr][td][/td][td]Set 1[/td][td]Set 2[/td][/tr]
[tr][td]Enter[/td][td]0x1C[/td][td]0x5A[/td][/tr][/table]
slacker

Re:default scan code set

Post by slacker »

******FROM SITE*****Only scancode set 2 is widely supported and relatively free of bugs. However, the 8042 can be (and usually is) programmed to convert set 2 scancodes from the keyboard to set 1. The 8042 also handles some non-keyboard functions, such as resetting the CPU, controlling the A20 gate, and communicating with a PS/2 mouse.********************************

ive been using set 2 and 0x1c=enter...maybe the controller converts set 2 to set 1(above)?
RicoSanchez

Re:default scan code set

Post by RicoSanchez »

But how do you know what scancode set you are using. And how do you know if the scancode set is converted to another scancode set?

And then an important question. Does it matter what scancode set you are using? It is probably best to convert any of the scancode sets to your own defined scancode set, right?

And why do different scancode sets exist? Does one support more keys than the other ones?
K.J.

Re:default scan code set

Post by K.J. »

From the 486(possibly 386 too, I'm not sure though) and up, by default the keyboard outputs scancode set 2, and the keyboard controller translates those set 2 scancodes into set 1.
But how do you know what scancode set you are using. And how do you know if the scancode set is converted to another scancode set?
By sending bytes to certian ports and reading other ports, read section 4 of this doc:
http://osdev.neopages.net/docs/wout_kbd.php

Hope this helps,
K.J.
Post Reply