Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

events in c?

Status
Not open for further replies.

mikledet

Programmer
Mar 14, 2002
3
DE
Hi all,

Is there a way, to have a program in C, react to events,
such as a key stroke?
I mean, to have the program be event driven, for example - no matter at what point the execution of the program is, if key is pressed - it should execude func().

Any pointer, example code, book referance or url will be very welcome.

Thanks.

(yes, I am new to c...)
 
Well,

I guess it has to do with CallBack function usage right?

I understand how to define and write a call back function,
but i dont understand, how can i tell the system to call my call back - when lets say "x" was pressed?

Thanks
 
Under which OS do you need this ?.
If DOS/Windows then think about the interrupts.
If UNIX then think about Signals
 
Thanks - however, in the mean while i have read some more, and now I know better what i am looking for.
It looks like what I need is a multithreaded application - in which, one thread will be monitoring keyboard input,in paralel to another thread that will do other stuff.
Any pointers and url's about multithread programing in C (dos/win) will be most welcome.

Thanks.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top