hi i am trying to make a program that whilst ingame (magicka if anyone is interested) reads what is pressed on the keyboard and the simulates a combination of keyboard key down and keyboar key up and mouse press.
eg if i press NumPad0 it would simulate Key Press A, Key Press S, Key Press F
or if i press NumPad1 it would simulate Shift Down, LButton Press, Shift Up
i have already managed to read what is pressed on the keyboard and know just need to know how to simulate pressing my combination
i have read about DirectX's SendInput and other stuff but was wondering what is the best way to do this so the game will read what inputs i have pressed? and also if anyone has any good tutorials/help sites they can link me to!
Re: how simulate keyboard and mouse whilst in game?
well i dont really no what a bot is as i never use them, but im not here to cheat. all im looking to do is make some hotkeys so i can cast my spells quicker. the game is a co-op online, no versus, so it's not hindering anyone else.
Re: how simulate keyboard and mouse whilst in game?
Well, you could probably get away with using an existing (and totally awesome) tool like AutoHotKey. This program does the work for you and already knows how to hook into Windows keyboard events. You can create macros for whatever you like with it.
Re: how simulate keyboard and mouse whilst in game?
Ok, then you need to learn the Windows API, specifically how keyboard hooks work. There are countless articles on the subject all over the net already.
Re: how simulate keyboard and mouse whilst in game?
Yer I have seen loads of articles on it aswel! I was not really asking how to do it but what is the best way to do it as i have also read that people didn't find certain ways didn't work with directx! So will Windows API and keyboard hooks work with directx?
Thanks Ollie
Last edited by geekman92; May 2nd, 2011 at 11:59 PM.
Reason: typo
Bookmarks