Jump to content
  • Advertisement


  • Content Count

  • Joined

  • Last visited

Community Reputation

122 Neutral

About Caeddyn

  • Rank
  1. Caeddyn

    2 player one computer games

    Combat Tanks
  2. Caeddyn

    Simulating keyboard input

    *bump* I still haven't fixed the problem and it's very frustrating. Please help. -Caeddyn
  3. Caeddyn

    Simulating keyboard input

    Heh, for some reason I didn't think about just looping the function. However when I tried your solution, it just pressed the spacebar very, very rapidly. That's not what I'm looking for; it needs to hold the key down. Thanks anyway. -Caeddyn
  4. Hi, I'm writing a program which grabs what your type on one computer, and types it on another. I have most of this program done, but I'm having trouble simulating key presses correctly. #include <iostream> #include <windows.h> using namespace std; int main() { Sleep(5000); keybd_event(VK_SPACE, MapVirtualKey(VK_SPACE, 0), 0, 0); Sleep(10000); keybd_event(VK_SPACE, MapVirtualKey(VK_SPACE, 0), KEYEVENTF_KEYUP, 0); return 0; } In this sample code I'm trying to hold the spacebar down for 10 seconds. But, what actually happens is the spacebar is being pressed and immediately released. Am I using keybd_event incorrectly? Is there some other function I can use to hold a key down for N seconds? My program MUST work on Windows 98, so I can't use SendInput. Thanks. -Caeddyn
  5. Quote: How many programmers does it take to change a lightbulb? Only one. But it'll take him all night, and the refrigerator will end up broken.
  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!