Originally posted by nate11000
Hey, and thanks for your help in advance. What I want to do is send specific keystrokes to the system at certain times, kind of like a macro. As in, I want to run this program and have it "press" the ALT+F keys, or whatever. You get the idea. Moving the mouse would be cool, too, but not necessary. Can anyone help me out? Thanks again.
If your using Windows, then look into the SendInput function, which works for both mouse and keyboard. Here's an example:
Code:
INPUT i;
i.type = INPUT_KEYBOARD;
i.ki.wVk = 0; /* virtual key code goes here, or 0 if none */
i.ki.wScan = 0x50; /* scan code goes here, 0 if none */
i.ki.dwFlags = KEYEVENTF_SCANCODE; /* flags */
i.ki.dwFlags = 0; /* more flags */
i.ki.time = 0; /* time of keypress, 0 = now */
i.ki.dwExtraInfo = NULL;
SendInput (1, &i, sizeof(INPUT));