This is the mail archive of the crossgcc@sources.redhat.com mailing list for the crossgcc project.

See the CrossGCC FAQ for lots more information.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: kbhit()


Hi,

> int main()
> {
> while(1)
> {
>      if (kbhit()) //in the lib function i changed to kb_kbhit()
>          printf("key pressed...\n");
> }
> }

	Remove char code from keyboard buffer (with getch() for example). Until you 
do, there is pressed key, so your 'if' will be always true and you'll have 
endless 'printf'.

Regards,

Marcin Wolcendorf.

------
Want more information?  See the CrossGCC FAQ, http://www.objsw.com/CrossGCC/
Want to unsubscribe? Send a note to crossgcc-unsubscribe@sourceware.cygnus.com


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]