Keybord drivers
Keybord drivers
i went up to page 40 and couldnt find any keybord support that works, i am on my 3rd hour of programming and i need help to find keypress support, i am using djgpp and i need input suport for my doslike , thus far, os. links or codes are appreciated thks in advance.
i will be back soon it is time to take a break.
THOOVER
i will be back soon it is time to take a break.
THOOVER
- Combuster
- Member
- Posts: 9301
- Joined: Wed Oct 18, 2006 3:45 am
- Libera.chat IRC: [com]buster
- Location: On the balcony, where I can actually keep 1½m distance
- Contact:
Maybe try different search queries on google...
http://www.osdev.org/osfaq2/index.php/G ... rd%20Input
Sample KB module from my os:
http://dimensionalrift.homelinux.net/co ... dumper.bas
http://www.osdev.org/osfaq2/index.php/G ... rd%20Input
Sample KB module from my os:
http://dimensionalrift.homelinux.net/co ... dumper.bas
Also look here: http://www.osdev.org/phpBB2/viewtopic.php?t=12332
I made this code,
i need help with it it dosnt work at all what did i do wrong.
Code: Select all
unsigned char getch()
{
char in;
char oin;
outportb(0x60,0xf4);
outportb(0x64,0x60);
outportb(0x64,0x20);
outportb(0x60,0xff);
oin=inportb(0x60);
do {
in=inportb(0x60);
} while(in == oin);
}
- Combuster
- Member
- Posts: 9301
- Joined: Wed Oct 18, 2006 3:45 am
- Libera.chat IRC: [com]buster
- Location: On the balcony, where I can actually keep 1½m distance
- Contact:
What those writes to port 60h and 64h are doing, i have no clue. No code i've seen used that, so why would you?
As for the second part, you are reading a keypress, then you are waiting for a different scancode (the release, another keypress, or the remaining scancode). This would only give you each other scancode, possibly making you lose half the information you wanted.
Also, no return value?
As for the second part, you are reading a keypress, then you are waiting for a different scancode (the release, another keypress, or the remaining scancode). This would only give you each other scancode, possibly making you lose half the information you wanted.
Also, no return value?
i got it off of a another forum here: http://www.osdev.org/phpBB2/viewtopic.php?t=306 the last reply it worked once for me but it wont work again. which i believe is odd.
nvm i fixed it now it is:
works perfectly now
all i have to do is set up which key is which bye
Code: Select all
unsigned char getch()
{
char in;
char oin;
outportb(0x60,0xf4);
outportb(0x64,0x60);
outportb(0x64,0x20);
oin=inportb(0x60);
do {
in=inportb(0x60);
} while(in == oin);
}
all i have to do is set up which key is which bye