Macros

This is a discussion on Macros within the C++ Programming forums, part of the General Programming Boards category; How could I make a macro so the Enter key is pressed continuously over a period of time? This is ...

  1. #1
    Registered User
    Join Date
    Sep 2006
    Posts
    55

    Macros

    How could I make a macro so the Enter key is pressed continuously over a period of time? This is for a dedicated game server. The games only last 15 mintues so when it goes to lobby, I want it to press enter automatically when I am AFK. I used a macro program before but I am putting it in my own program instead. Thanks

  2. #2
    Devil's Advocate SlyMaelstrom's Avatar
    Join Date
    May 2004
    Location
    Out of scope
    Posts
    4,074
    Assuming this is for Windows... look in MSDN. They have functions to simulate keypresses in <windows.h>... it's not difficult once you get the function. The hardest part is making it turn on from the game... you'd likely have to minimize and activate it if you don't want to put the extra work in.
    Sent from my iPadŽ

  3. #3
    Registered User
    Join Date
    Sep 2006
    Posts
    55
    Well, I was just going to set it to a hotkey to activate the macro function. The game would have to be maximized however. I'll check out msdn and see what I can find. thanks

    Edit:

    Think this might be useful, keybd_event function..hmm

    http://msdn.microsoft.com/library/de...eybd_event.asp

    Windows NT/2000/XP:This function has been superseded. Use SendInput instead.

    http://msdn.microsoft.com/library/de.../sendinput.asp
    Last edited by silentkarma; 09-16-2006 at 01:43 PM.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Order of execution of preprocessor macros
    By DL1 in forum C Programming
    Replies: 2
    Last Post: 04-02-2009, 06:52 PM
  2. Pre-processor macros causing segfaults
    By nempo in forum C++ Programming
    Replies: 6
    Last Post: 02-10-2009, 01:35 AM
  3. Macros inside of macros
    By Chewie8 in forum C Programming
    Replies: 2
    Last Post: 02-24-2008, 02:51 AM
  4. Macros vs Inline Functions
    By vb.bajpai in forum C Programming
    Replies: 4
    Last Post: 08-02-2007, 11:51 AM
  5. template fn replacements for msg macros
    By Ken Fitlike in forum Windows Programming
    Replies: 17
    Last Post: 10-30-2002, 06:55 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21