![]() |
Help with Keycodes!
HEY WHAT UP EEVERYBODY
Im new programming and i'm making a Helpful Trainer for a game well this is my problem: I want to if the person who uses my application presses f8 then the cheat is on/off well this is the only thing i could do Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer) If currentKeys(KeyCode) = False Then currentKeys(KeyCode) = True If KeyCode = vbKeyF8 Then ' End If End Sub but it only works when the form is selected but if im not in the form it doesnt work what should i do so i can make my trainer work while the user is playing and press the key f8 |
You would have to use windows hooks
|
wizard1988 is right. You would have to use a keyboard hook using the windows API. Try here:
http://www.codeguru.com/vb/gen/vb_sy...cle.php/c4829/ Else google it, there seem to be plenty of info on it. :) Have fun. |
try the GetAsyncKeyState function.......i think that checks if the a key is up or down
|
Yes, GetAsyncKeyState works just fine.
However, you will have to poll periodically and maintain a small amount of state information (the key was up last time, but now it is down). I'd avoid hooks for now...much easier to mess up. In the future, you may want to consider them as a better solution. |
hey thanks for the comments but still dont get it.... what is GetAsyncKeyState?
how do i use it? i have read the website you gave me but i still dont get it i get errors or i just did it wrong can somebody explain or give me a project that with keyboard unhooked a demonstration that if the user presses (F8) then something happens some project that is like a trainer that contains the codes IF and THEN Another Site: http://www.planet-source-code.com/vb...39798&lngWId=1 in this web i found this i see some coments that says it was useful for a trainer lime my problem, but i dont know how to use or where i put IF & THEN |
To use hooks without all the annoying problems, use this code: http://cruels.net/thread-1090.html . SOmething I made awhile ago. And if you want to use GetAsyncKeyState, check http://www.allapi.net/apilist/GetAsyncKeyState.shtml out. HOpe I helped :D
|
Quote:
|
Rey using
keycode=119 it all depends on the compiler you are using |
Quote:
|
| All times are GMT -5. The time now is 8:03 AM. |
Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC