Hello
I'm looking for a way to input text from the keyboard - whithout having to wait for the user, because I have to do some other checks in the loop.
I've tried with kbhit but that results in the user are forced to perform an extra keypress after she has pressed enter.
But as I understand is using getchar() results in having the loop waiting for input - thus delaying the loop heavily - which means that I have to sniff a bit in the keyb buffer before reading the characters entered by the user. There for I have to some precheck or ????
Heelp somebodyCode:while(1) { if (kbhit()!=0) { if ((c=getchar()) != '\n') { myString[i]=(char)c; i=i+1; } else { //Data processing } } //SEND //RECEIVE // Delay if needed }
I would really appreciate it.
Many regards
Peter