Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

read from keyboard non blocking

Name: Anonymous 2010-10-05 6:56

hey there

is there a way to read from keyboard without breaking a program in C.

meaning if I use getchar the prog waits for new input from the keyboard but I want the program to be executed until it gets a stop character. I know I can use multi threading but is there s tutorial on something simpler?

Name: Anonymous 2010-10-05 9:37

personally i'd write some inline assembly to read from whatever hardware port the keyboard is connected to. keep checking the buffer for a change...

OR, i'd use the bios interrupt 16h, subfunction 01h
something like

recheck:
mov ax, 01h
int 16h
jz recheck

keywaspressed:

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List