Raise click event on other program

OK, I want to work on a key mapper program to redefine keys for a game. So my question is: is there a way to raise events on another program? For example, in the game I find myself hold down the right mouse button for extended periods of time, so I want to have my program watch the "~" key, and when it is pushed to send the game the right_mouse_button_down event, and then the next time to send the right_mouse_button_up event? How can I cause these events to be sent to another program?
Can I ask what game this is? And why we are going to such lengths when there would probably be a key re-mapping option?

If this is academic then feel free to ignore me of course.
It's Dungeon's and Dragons online. I can remap keys, but even if I remap right mouse button (which it won't let me) I would be holding the other key down the whole time. The point is I want one key press to send RightMouseButtonDown and the next key press to send RightMouseButtonUp so it keeps the mouse button held down
@ webJose, this worked, thank you very much!
Cool. Now post your mod for others to use it as well. :D
I will eventually, I still want to make it a full key-mapper, and it will be usable with any program, including macros, I'll keep you updated on this thread if you're interested
Topic archived. No new replies allowed.