Hotkeys for Console Applications

Is it possible to make my console application detect if I press a C key when the window is focused? I want to do almost the same concept of key logging but I would like my program to execute keystrokes if I press a certain key, so a macro program in short. Eg. if I press W, then it should press W twice with an interval of 10 milliseconds
Vim can recognize Ctrl keys, so it must be possible. I have no idea how, though. I wonder if ncurses has some mechanism for that...
Use ncurses library.
If I understand you correctly, you'd like to do something like create macros for an existing program, and/or automate responses to an existing program?

This is a fairly advanced concept, and I think you are in for more trouble than it is worth (at the start, at least) using C++. I recommend you get yourself a copy of Expect:
http://wiki.tcl.tk/201
http://wiki.tcl.tk/11584

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