Page 3 of 3
Re: Detecting PS/2 and AT
Posted: Wed Jul 02, 2008 2:45 am
by jal
Brendan wrote:Originally there were 2 control keys that gave the same scancode.
Not quite. The original XT keyboard had only one Ctrl-key and one Alt-key, but two Shift-keys. That's why the shift keys have their own code, and the Ctrl and Alt have the same + extended (for the reason you mentioned: backwards compatibility). Everything else you write is correct, it's all done for backwards compatability (with the original XT!).
JAL
Re: Detecting PS/2 and AT
Posted: Fri Jul 04, 2008 4:59 pm
by ChazZeromus
Brendan wrote:Hi,
ChazZeromus wrote:Why is right control have a way different scancode than the left?
Originally there were 2 control keys that gave the same scancode. Then they added extended scancodes (scancodes that begin with an 0xE0 byte) and gave the right control key it's own scancode (so you could tell which control key was pressed), but they did it in a way that made sense if you ignored the 0xE0 byte (because old software that was written beforehand ignores 0xE0). For example, left control is 0x14 while right control is "0xE0 0x14" (which gives backward compatible scancodes for the old software). The same is true for other keys, like left and right alt; and up, down, left, right, pgup, pgdown, end, delete, home and insert (which had scancodes on the numerics keypad but were given extended scancodes when they became seperate keys).
In a similar way the scancode for prntScrn is backward compatible with the scancodes for "left_shift + keypad_*", and the scancode for pause is backward compatible with the scancodes for "control + numLock" (where 0xE1 is strange because the new right control already used the 0xE0 byte).
Note: For all of the above I'm talking about scancode set 1 (or translated scancode set 2). For untranslated scancode set 2 it's the same with different numbers...
ChazZeromus wrote:How can I get the same multiple input intervals for the pause key?
What do you mean by "multiple input intervals"? If you want to get a break code when pause is released (like normal keys) then you can't unless you use scancode set 3 (which isn't recommended)..
Cheers,
Brendan
Well Im only getting one scancode for the pause key when i hold it down, so configuring the keyboard controller to set 3 well change this? Well that drastically change anything else?
Re: Detecting PS/2 and AT
Posted: Fri Jul 04, 2008 11:30 pm
by Brendan
Hi,
ChazZeromus wrote:Well Im only getting one scancode for the pause key when i hold it down, so configuring the keyboard controller to set 3 well change this?
Yes - in scancode set 3 you should get a make scancode when "pause" is pressed and then (some time later) a break scancode when it's released.
ChazZeromus wrote:Well that drastically change anything else?
Yes - you'll end up with unreliable code, because lots of keyboards don't support scancode set 3, and AFAIK there's no way to determine if scancode set 3 is supported or not.
Cheers,
Brendan