Multi-byte keyboard scancodes
Posted: Sat Nov 14, 2015 5:28 pm
While I've found many useful resources on handling interrupts and writing a keyboard driver, there's one aspect of it that has bothered me from the start, which is the presence of scancodes which are multiple bytes long. There's a couple of questions I've had from the beginning:
1. Can the keyboard encoder's buffer contain more than one scancode at a time?
2. If so, does the protocol provide a way to determine where each one ends?
3. If not, can you tell where an unrecognized scancode ends just from looking at it?
None of the resources I've found really seem to address this, which suggests to me that the answers are precisely what I don't want to hear:
1. Of course.
2. No.
3. Maaaayybe for set 3? But even then, probably best to still anticipate exceptions to the rule.
Which implies that (other than maaaaaybe set 3) there's no way to handle unrecognized scancodes cleanly (i.e. without impacting the reading of other scancodes), and thus you need to have a complete lookup table of all the scancodes that are possible. This seems impossible in general considering hardware differences and etc.. Can somebody please tell me I am wrong, and if not: how does one deal with this?
1. Can the keyboard encoder's buffer contain more than one scancode at a time?
2. If so, does the protocol provide a way to determine where each one ends?
3. If not, can you tell where an unrecognized scancode ends just from looking at it?
None of the resources I've found really seem to address this, which suggests to me that the answers are precisely what I don't want to hear:
1. Of course.
2. No.
3. Maaaayybe for set 3? But even then, probably best to still anticipate exceptions to the rule.
Which implies that (other than maaaaaybe set 3) there's no way to handle unrecognized scancodes cleanly (i.e. without impacting the reading of other scancodes), and thus you need to have a complete lookup table of all the scancodes that are possible. This seems impossible in general considering hardware differences and etc.. Can somebody please tell me I am wrong, and if not: how does one deal with this?