C programming help, detecting keyboard inputs

EmperorIQ

Platinum Member
Sep 30, 2003
2,003
0
0
What do i need in order for my program to detect a certain input from the keyboard? How do i enable interrupts in C?
 

EmperorIQ

Platinum Member
Sep 30, 2003
2,003
0
0
oh, and also, how do i detect an exact key? such as space bar, or up arrow and down arrow?

Thanks!
 

EagleKeeper

Discussion Club Moderator<br>Elite Member
Staff member
Oct 30, 2000
42,589
5
0
Once you detect the keypress (via an interrupt), then look at the character code.
That will tell you which key or key combinations are being pressed.

Interrupt 21h, Function 3Fh reads the eyboard