Send Input to Halo 2 Vista in C#
Hello, for all you C# programmers out there, ive got a question that i need answered.
I want to stimulate the mouse and keyboard. I know a few methods to do this but for some reason, they dont seem to work while im playing h2v.
So far, the only method that has worked is the SendKeys.Send function. unfortunately, SOMETIMES the game misses it and it ackts like if the function was never even used. I think this is becuase the function presses and lets go of the key way to fast before it evens give time for the game to detect it.
for example, if i press SendKeys.Send("f"); the game should punch...right? well sometimes it does and sometimes it doesnt. i found out that if i do SendKeys.Send("fffffffffffffffffffffffffff"); i have a greater probability of puching, but it still isnt enough to make it punch 100% of the time.
Is there a way to wait a while before the SendKeys.Send lets go of the button pressed? Is there a better way to send input that will work with directx games? If you have a way to do this in C++ that also works with h2v, feel free to post it also, I dont mind switching to C++ as long as it works
all help is appreciated
Re: Send Input to Halo 2 Vista in C#
I was using SendKeys with H2V a while ago as well, except in VB. It only seems to affect the ingame chat console if it's open. If anyone's got a better way, I'd also love to hear about it.
Re: Send Input to Halo 2 Vista in C#
I noticed that it worked on the chat too.
(lol, i was pretty mad and asking myself "Why the hell wont it work for gameplay!!!!?")
Re: Send Input to Halo 2 Vista in C#
One question: why would you want to simulate key-pressing?
Re: Send Input to Halo 2 Vista in C#
Quote:
Originally Posted by
Vicky
One question: why would you want to simulate key-pressing?
if someone could send key strokes in game play they could simulate a bxr or what ever its called so that they get it every time with only one click. in my opinion it would be a hack but that could be one use for why someone would want to be able to.
Re: Send Input to Halo 2 Vista in C#
Well you could always use the wait method: "SendKeys.SendWait("f");"
Also, there is a much more effective way of sending lots of the same letter: "SendKeys.SendWait("f 100");"..with the number representing the number of repeats.
MSDN Goes Into More Detail.
Re: Send Input to Halo 2 Vista in C#
Don't sent the keys...let windows press it...for mouse clicks I have the source somewhere...if you do use the send key function don't forget to...
System.Threat.Threating.Sleep(100)
If you let the program sleep for a few milliseconds the send key function works way better :)
Re: Send Input to Halo 2 Vista in C#
Quote:
Originally Posted by
Patrickssj6
System.Threat.Threating.Sleep(100)
fucking system threats....
Re: Send Input to Halo 2 Vista in C#
Quote:
Originally Posted by
Vicky
One question: why would you want to simulate key-pressing?
I am currently working on an app that will auto-butterfly and auto-rocket-sword-cancel
Quote:
Originally Posted by
Patrickssj6
System.Threat.Threating.Sleep(100)
If you let the program sleep for a few milliseconds the send key function works way better :)
I think you mean System.Thread.Threading.Sleep(number_of_millisecon ds);
but i have a question, what does this do? I know it stops the program from what ever its doing, but does this mean that if i use it after the SendKeys.Send() function, it will hold down the key longer before letting go?
Quote:
Originally Posted by
Prey
there is a much more effective way of sending lots of the same letter: "SendKeys.SendWait("f 100");"..with the number representing the number of repeats.
I found no difference using the SendKeys.SendWait() function
btw, you forgot the brackets...its supposed to be SendKeys.Send("{f 100}");
Quote:
Originally Posted by
Kornman00
fucking system threats....
LOL:D
Re: Send Input to Halo 2 Vista in C#
Quote:
Originally Posted by
Sprt4n117
I am currently working on an app that will auto-butterfly and auto-rocket-sword-cancel
Butterflies:confused2: Rockets-swords:confused2: Either i'm on the wrong drugs or do we share the same H2V?