-
May 2nd, 2011, 04:45 PM
#1
how simulate keyboard and mouse whilst in game?
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!
Thanks in advance =)
Ollie
-
May 2nd, 2011, 04:58 PM
#2
Re: how simulate keyboard and mouse whilst in game?
Sooo... you're trying to create a bot? How do the game developers feel about that?
-
May 2nd, 2011, 05:01 PM
#3
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.
please can you help me?
-
May 2nd, 2011, 08:02 PM
#4
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.
-
May 2nd, 2011, 08:05 PM
#5
Re: how simulate keyboard and mouse whilst in game?
okay thanks for that but part of this is to improve/keep up my programming skills! if i give up on this project i will defo use that, thanks!! =)
-
May 2nd, 2011, 11:45 PM
#6
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.
-
May 2nd, 2011, 11:57 PM
#7
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
-
April 27th, 2021, 08:49 AM
#8
Re: how simulate keyboard and mouse whilst in game?
Hello!
Can somebody please tell me how do I turn on the Auto Clicker.
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|