Ask your own question, for FREE!
Computer Science 14 Online
OpenStudy (anonymous):

How do I build an event-driven console application?

OpenStudy (shadowfiend):

Noice.

OpenStudy (shadowfiend):

What do you mean by event-driven?

OpenStudy (shadowfiend):

Also feel free to ask the other questions you had posted to math here, I'll try and answer as best I can (I already deleted them over there—stack traces, errors vs exceptions, etc).

OpenStudy (shadowfiend):

No, I mean specifically as it pertains to a console app. What kinds of events do you have in mind, that kind of thing.

OpenStudy (anonymous):

keypresses :-D

OpenStudy (shadowfiend):

I'm aware of what event-driven programming is; it's how dynamic web pages work! :)

OpenStudy (shadowfiend):

Ok, gotcha. You'll probably want to look into one of two libraries. One is called GNU readline -> http://cnswww.cns.cwru.edu/php/chet/readline/rltop.html . I believe it provides the ability to hook into keypresses. The other is ncurses, which is designed for full-blown GUI-like apps in the console -> http://www.gnu.org/s/ncurses/ .

OpenStudy (anonymous):

Are they like conio.h

OpenStudy (shadowfiend):

They're probably a bit more advanced than conio.

OpenStudy (anonymous):

Yeah conio is deprecated :-P

OpenStudy (shadowfiend):

It's also for MS DOS hehe. The thing I don't know is whether either work with DOS/the Windows shell. They may be UNIX only, and thus require at minimum cygwin on Windows.

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!