^d, ^t , ^shift t, etc

Can anyone please tell me or give any resource as to how can I write a cplusplus code for getting an input such as ^d and opening a new file or stuff like that....
(essentially I want to ape shell script but I want to do some modifications and I am not getting how to catch any other interrupt than ^c which for most of my purposes is useless! I really don't have a good idea of interrupts though!! So if relates to that, please elaborate a bit... )
regards
Pratyush
You have to set the terminal to "raw" mode.

If you are doing this in shell scripting, check out the "stty" command. Here's a page that I googled that deals with exactly that:

http://osr507doc.sco.com/en/OSUserG/_How_to_get_a_character.html

It isn't terribly difficult to do in C++ either, but there are caveats. You might want to google around the "curses" library. (ncurses is the latest version, and pdcurses works on Windows and is fairly compatible with ncurses. Both ncurses and pdcurses leave the old curses library in the dark ages.)

Hope this helps.
Topic archived. No new replies allowed.