keyboard not so dumb?
Posted: Sat May 24, 2008 9:05 am
hi
after having my os lay idle for quite a while, i was just playing around with it and noticed some strange behaviour.
i have a table for my keyboard driver which is laid out a bit like this:
table: [
actionWhenKeyUnshifted, actionWhenKeyShifted,
...
]
I used to have only entries for "normal" characters like abce..xyz in that table, completely leaving out numbers and special characters.
Now I just wante to add the colon,semicolon,commam and full stop characters (which on my german keyboard are entered by pressing the keys just right to the "m" key.
so i made the respective entries in the keyboard table:
table: [
...
',', ';',
'.', ':'
...
]
When I press the respective keys unshifted, everything is fine, but when I press the two keys shifted, their respective characters (';', ':') dont appear on the console.
I then inserted a putunsint call in the keyboard interrupt service just to see the scancode, an the result quite surprised me:
When I press the key just right beside the 'm' key unshifted, the make and break codes are 102 and 358. When I press the very same key shifted, the make and break codes are: 78 and 334. Shouldnt the keyboard ALWAYS send the same make and break codes irrespective of what other keys are pressed?
PS I use bochs...
after having my os lay idle for quite a while, i was just playing around with it and noticed some strange behaviour.
i have a table for my keyboard driver which is laid out a bit like this:
table: [
actionWhenKeyUnshifted, actionWhenKeyShifted,
...
]
I used to have only entries for "normal" characters like abce..xyz in that table, completely leaving out numbers and special characters.
Now I just wante to add the colon,semicolon,commam and full stop characters (which on my german keyboard are entered by pressing the keys just right to the "m" key.
so i made the respective entries in the keyboard table:
table: [
...
',', ';',
'.', ':'
...
]
When I press the respective keys unshifted, everything is fine, but when I press the two keys shifted, their respective characters (';', ':') dont appear on the console.
I then inserted a putunsint call in the keyboard interrupt service just to see the scancode, an the result quite surprised me:
When I press the key just right beside the 'm' key unshifted, the make and break codes are 102 and 358. When I press the very same key shifted, the make and break codes are: 78 and 334. Shouldnt the keyboard ALWAYS send the same make and break codes irrespective of what other keys are pressed?
PS I use bochs...