Anonymous user
PS/2 Keyboard: Difference between revisions
Added full code.
[unchecked revision] | [unchecked revision] |
m (→Overview) |
(Added full code.) |
||
Line 226:
* Various "toggle" states (CapsLock, ScrollLock, NumberLock, etc)
== Enough, give me code! ==
So, first read the scan code set table, and now start to code. If you too lazy, there's a full code:
<source lang="c">
/*
PS/2 keyboard code.
Dependencies:
inb function and scancode table.
*/
char getScancode()
{
char c=0;
do {
if(inb(0x60)!=c)
{
c=inb(0x60);
if(c>0)
return c;
}
}while(1);
}
char getchar()
{
return scancode[getScancode()+1];
}
</source>
== Scan Code Sets ==
|