User32 commands!
Too lazy to write up, but you can find it on MSDN.
There's one address for sending the key "D" then one for lifting the key "D".
It's the same as an auto clicker, there's one for sending the click, and one for lifting the click.
Ok i need help to code this:
Pressing down the key "D" for only 10 milliseconds. after that it will stop.
how would i do that?
User32 commands!
Too lazy to write up, but you can find it on MSDN.
There's one address for sending the key "D" then one for lifting the key "D".
It's the same as an auto clicker, there's one for sending the click, and one for lifting the click.
make a timer of 1 millisecond
make it enabled
dim number as string
Timer1.Tick
if number <= 10 then
sendkeys.send(keys.d)
number = number + 1
else
timer1.enabled = false
end if
end sub
yea agree...why would you pick a string for numbers =P
wat if i want to make it hold "D" down for 5 seconds.
right now the code:
It keeps clicking "D" for 5 seconds.Code:Timer1.Tick if number <= 5000 then sendkeys.send(keys.d) number = number + 1 else timer1.enabled = false end if end sub
Learn User32 key commands!
Google it.
It's complicated but it's the only way to solve your problem.
would someone be able to post a tut on user32.dll for key presses.
Code:Timer1.Tick if number <= 5000 then sendkeys.send(keys.d) number = number + 1000 else timer1.enabled = false end if end subCode:Timer1.Interval = 1000 timer1.enabled = truetimer.tick...Code:Private Declare Function GetAsyncKeyState Lib "user32" (ByVal vkey As Long) As Integer
Code:Dim f1 As Boolean f1 = GetAsyncKeyState(Keys.F1) If f1 = True Then 'your code End If
Last edited by Blubb1337; 03-02-2010 at 04:23 PM.
ppl2pass (03-02-2010)
thanks would this code work i wanted to hold the key "D" for 5 seconds?
btw when i press f2 the numbers 68 show up.Code:Timer1 Dim f1 As Boolean Dim number As String f1 = GetAsyncKeyState(Keys.F1) If f1 = True Then Timer1.Interval = 1000 Timer1.Enabled = True If number <= 5000 Then SendKeys.Send(Keys.D) number = number + 1000 End If End If
Last edited by ppl2pass; 03-02-2010 at 04:44 PM.
Will work, however, it will not hold the keydown , it will press it, on and off..Code:Dim f1 As Boolean Dim number As String f1 = GetAsyncKeyState(Keys.F1) If f1 = True Then Timer1.Interval = 1000 Timer1.Enabled = True If number <= 5000 Then SendKeys.Send(Keys.D) number = number + 1000 End If End If
pinvoke.net: sendinput (user32)
READ this article, and don't just copy and paste it!
It'll help you with your problem.
NextGen1 (03-02-2010)
Nextgen is a FREKIN beast at helping people. along with lolland
Need Help With Coding or Something??? MSN me
zmansquared@hotmail.com
I am the one and only Microsoft Fag!!!
Quote:
Originally Posted by Arhk
All games should be hacked, if we don't do it someone else will. Hackers force the progress, of better programming methods.
~
Take this Pic everyone!
next-
NextGen1 (03-02-2010)