Override For fun
Albin Engström

Is there a way to "override" any type of input? for example, a program that handles keyboard input for you. would be awesome :).

ReyBrujo

Not that I know of. You need to program every interface, and some libraries can "hide" technical implementation (like Allegro itself), but you will have to tell the interface that pressing W is the same as pressing up, moving the mouse up or pushing the joystick up.

By the way, I am moving this post.

Albin Engström

I'm not sure why, but i get the feeling i'm misunderstood...
i meant, instead of me pressing a key, how about making the computer do it and make it look like i did it. -.-?

Elverion

Albin: You might be interested in a project that I have been working on for quite awhile (well, right now it is stalled. Not because I'm sick of working on it--but rather, I don't know what more to add). You can find more information on my macro program here: http://solarimpact.servegame.com/micromacro/index.php

You might use the program itself (Windows only at the moment, but if anyone has any suggestions for Linux alternative functions to use, let me know), or use the macro.cpp and macro.h in your own project. Check the online manual for a list of all the cool things my macro program can do.

Edit: attaching source.

Rampage
Tobias Dammers

Windows has a function that simulates a keypress (system-wide), IIRC it's called keyb_event.

Albin Engström
Elverion said:

You might be interested in a project that I have been working on for quite awhile (well, right now it is stalled. Not because I'm sick of working on it--but rather, I don't know what more to add).

I'll take a look at it :).

Rampage said:

simulate_keypress(), simulate_ukeypress().

I'll test them.

Elverion

I believe the simulate_keypress() related functions only work within the allegro program. That is, it jams the information into its own key buffer and will not effect any other program in any way. From what I can tell, it would be nearly useless for what you intent to use it for.

ReyBrujo

ungetc

By the way, back to programming forum, since it is obvious now it is programming oriented ;)

Albin Engström
Elverion said:

I believe the simulate_keypress() related functions only work within the allegro program. That is, it jams the information into its own key buffer and will not effect any other program in any way. From what I can tell, it would be nearly useless for what you intent to use it for.

I was afraid so.
anyway, i still haven't tested your program, but i will when i get the time :). and learn lua..

ReyBrujo said:

By the way, back to programming forum, since it is obvious now it is programming oriented

:P

Elverion
Quote:

anyway, i still haven't tested your program, but i will when i get the time :). and learn lua..

No hurry. When/if you do, please let me know what you think. As I've said before, it is not yet finished, so there are still bugs to work out. Lua is also quite simple and I expect you'll pick it up in no time. I've done most of the Lua-side work for you as well. It's just a mater of creating your own function, implementing a main loop within it, and calling your function from the startMacro() function. If you need help figuring it out, let me know and I will be happy to help.

Note that the program might not work for everything. In fact, right now I'm working on a system to work around those pesky GameGuard and nProtect systems. And it'll have the added benefit of repairing any other rootkits you're running ;) Until that is done, check the help file included with the package for a few work-arounds that have not failed me yet.

Albin Engström
Elverion said:

No hurry. When/if you do, please let me know what you think. As I've said before, it is not yet finished, so there are still bugs to work out. Lua is also quite simple and I expect you'll pick it up in no time. I've done most of the Lua-side work for you as well. It's just a mater of creating your own function, implementing a main loop within it, and calling your function from the startMacro() function. If you need help figuring it out, let me know and I will be happy to help.

Note that the program might not work for everything. In fact, right now I'm working on a system to work around those pesky GameGuard and nProtect systems. And it'll have the added benefit of repairing any other rootkits you're running ;) Until that is done, check the help file included with the package for a few work-arounds that have not failed me yet.

Nice, can't wait to test it. :)

Thread #591234. Printed from Allegro.cc