Making keyboard macros

Whether you're a newbie or an experienced programmer, any questions, help, or just talk of any language will be welcomed here.

Moderator: Coders of Rage

Post Reply
User avatar
superLED
Chaos Rift Junior
Chaos Rift Junior
Posts: 303
Joined: Sun Nov 21, 2010 10:56 am
Current Project: Engine
Favorite Gaming Platforms: N64
Programming Language of Choice: C++, PHP
Location: Norway

Making keyboard macros

Post by superLED »

Hello there!

I am currently developing a small program that allows me to take control over the keyboard.
However, I've come across a wall that I need to climb over to make further progress.

Until now, I've set almost everything up. I have programmed a window with different menus,
and I can read the user's input (tracking the keys that are being pressed).

And with that information stored, I want to set that key to do something special, like automatically type "Hello my friend!".
Here's my problem, you see. I have no clue on how I can make the program type anything at all.
I really need to know how I can make my program type stuff out, just like you would typing on the actual keyboard.

I am using Windows Vista, programming in C++ with Dev-C++ as my IDE.

Thanks for all answers!
pritam
Chaos Rift Demigod
Chaos Rift Demigod
Posts: 991
Joined: Thu Nov 13, 2008 3:16 pm
Current Project: Elysian Shadows
Favorite Gaming Platforms: Amiga, PSOne, NDS
Programming Language of Choice: C++
Location: Sweden

Re: Making keyboard macros

Post by pritam »

This. Make sure you delay the keystrokes a little bit one after the other, too many of them will have you forced to cut the power so be careful.
User avatar
dandymcgee
ES Beta Backer
ES Beta Backer
Posts: 4709
Joined: Tue Apr 29, 2008 3:24 pm
Current Project: https://github.com/dbechrd/RicoTech
Favorite Gaming Platforms: NES, Sega Genesis, PS2, PC
Programming Language of Choice: C
Location: San Francisco
Contact:

Re: Making keyboard macros

Post by dandymcgee »

You could always take a look at http://www.autoitscript.com for a higher level approach. It's a scripting language originally designed with automating windows tasks in mind. Developing something like this would take just a few minutes for anyone with a basic understanding of programming.
Falco Girgis wrote:It is imperative that I can broadcast my narcissistic commit strings to the Twitter! Tweet Tweet, bitches! :twisted:
User avatar
superLED
Chaos Rift Junior
Chaos Rift Junior
Posts: 303
Joined: Sun Nov 21, 2010 10:56 am
Current Project: Engine
Favorite Gaming Platforms: N64
Programming Language of Choice: C++, PHP
Location: Norway

Re: Making keyboard macros

Post by superLED »

Thank you so much! Got just what I was looking for.
Now the journey can finally move on :D
Post Reply