Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old May 31st, 2006, 10:26 PM   #1
Darcksky
Newbie
 
Join Date: May 2006
Posts: 18
Rep Power: 0 Darcksky is on a distinguished road
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
Darcksky is offline   Reply With Quote
Old May 31st, 2006, 10:46 PM   #2
Wizard1988
Professional Programmer
 
Wizard1988's Avatar
 
Join Date: Oct 2005
Location: Chitown
Posts: 422
Rep Power: 4 Wizard1988 is on a distinguished road
You would have to use windows hooks
Wizard1988 is offline   Reply With Quote
Old Jun 1st, 2006, 2:02 AM   #3
Booooze
Expert Programmer
 
Booooze's Avatar
 
Join Date: Mar 2006
Location: Igloo
Posts: 710
Rep Power: 3 Booooze is on a distinguished road
Send a message via MSN to Booooze
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.
Booooze is offline   Reply With Quote
Old Jun 1st, 2006, 3:11 AM   #4
kruptof
Professional Programmer
 
kruptof's Avatar
 
Join Date: May 2006
Location: UK - London
Posts: 333
Rep Power: 3 kruptof is on a distinguished road
try the GetAsyncKeyState function.......i think that checks if the a key is up or down
__________________
Quote:
When I was young it seemed that life was so wonderful,a miracle, oh it was beautiful, magical.
Now watch what you say or they'll be calling you a radical,a liberal, oh fanatical, criminal. Oh won't you sign up your name,we'd like to feel you're acceptable, respectable, oh presentable, a vegetable
kruptof is offline   Reply With Quote
Old Jun 1st, 2006, 3:24 AM   #5
Dameon
Troll
 
Dameon's Avatar
 
Join Date: Apr 2005
Location: Texas
Posts: 732
Rep Power: 4 Dameon is on a distinguished road
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.
__________________
MD5(sig) = bcef75433db02e9ad9bf81d6f7c5c270
Dameon is offline   Reply With Quote
Old Jun 2nd, 2006, 9:10 PM   #6
Darcksky
Newbie
 
Join Date: May 2006
Posts: 18
Rep Power: 0 Darcksky is on a distinguished road
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
Darcksky is offline   Reply With Quote
Old Jun 16th, 2006, 2:55 AM   #7
brownhead
Programmer
 
Join Date: Mar 2006
Location: California
Posts: 37
Rep Power: 0 brownhead is on a distinguished road
Send a message via AIM to brownhead Send a message via MSN to brownhead
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
brownhead is offline   Reply With Quote
Old Jun 27th, 2006, 5:53 PM   #8
Darcksky
Newbie
 
Join Date: May 2006
Posts: 18
Rep Power: 0 Darcksky is on a distinguished road
Quote:
Originally Posted by brownhead
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
that kinda help the GetAsynKeystates is more easy but it get's detected >.< so i will use the other one the harder one thanks for the website.
Darcksky is offline   Reply With Quote
Old Jul 19th, 2006, 3:21 PM   #9
linxis
Programmer
 
Join Date: May 2006
Location: USA
Posts: 52
Rep Power: 0 linxis has a little shameless behaviour in the past
Send a message via ICQ to linxis
Rey using
keycode=119
it all depends on the compiler you are using
__________________
Get programming and game creation tutorials and discuss apon you peers at
http://s14.invisionfree.com/tsoft
We also accept custom software requests and new mods will be needed soon
linxis is offline   Reply With Quote
Old Jul 19th, 2006, 6:56 PM   #10
Game_Ender
Professional Programmer
 
Game_Ender's Avatar
 
Join Date: May 2006
Location: Maryland, USA
Posts: 306
Rep Power: 3 Game_Ender is on a distinguished road
Quote:
Originally Posted by linxis
Rey using
keycode=119
it all depends on the compiler you are using
Umm... Visual Basic isn't its interpreted. So a compiler has nothing to do with this. Based on some of the other posts you made I am beginning to wonder whether you are just posting randomly.
Game_Ender is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 9:13 PM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC