| View previous topic :: View next topic |
| Author |
Message |
DJpieslice Newbie cheater
Reputation: 0
Joined: 19 Jul 2007 Posts: 16
|
Posted: Mon May 05, 2008 9:45 am Post subject: Hotkeys in Visual Basic |
|
|
I have a question -- How do I make hotkeys in visual basic?
I really need help on this for my first released trainer  |
|
| Back to top |
|
 |
Psy Grandmaster Cheater Supreme
Reputation: 1
Joined: 27 Mar 2008 Posts: 1366
|
Posted: Mon May 05, 2008 10:16 am Post subject: |
|
|
Well declare the function:
| Code: |
Public Declare Function GetKeyPress Lib "user32" Alias "GetAsyncKeyState" (ByVal key As Long) As Integer
|
Then in your main form (under a timer etc) do something like:
| Code: |
If GetKeyPress(vbKeyA) Then
<do some stuff>
End If
|
This is as simple as it can get.
If vbKeyA is pressed then run something you want, such as writing to memory your bytes  |
|
| Back to top |
|
 |
DJpieslice Newbie cheater
Reputation: 0
Joined: 19 Jul 2007 Posts: 16
|
Posted: Mon May 05, 2008 10:24 am Post subject: |
|
|
So VBkeyA would be the keyboard button 'A'?
So what if I want to make things like ctrl + S or whatever.
Do I say VBkeya + vbkeyctrl?
or is it more complicated?
Last edited by DJpieslice on Mon May 05, 2008 10:48 am; edited 1 time in total |
|
| Back to top |
|
 |
Slugsnack Grandmaster Cheater Supreme
Reputation: 71
Joined: 24 Jan 2007 Posts: 1857
|
|
| Back to top |
|
 |
Psy Grandmaster Cheater Supreme
Reputation: 1
Joined: 27 Mar 2008 Posts: 1366
|
Posted: Tue May 06, 2008 2:20 am Post subject: |
|
|
You can use the virtual keys and/or the vb keys.
| Code: |
If GetKeyPress(vbKeyShift) And GetKeyPress(vbKeyA) Then
<do some stuff>
End If
|
It really doesn't get much plainer.
In future your posts on this topic should be directed to general programming as thats what its there for, and you will get the replies you want if you post in the right place.
Do some searching of your own. You would have been able to find exactly what I told you if you have taken 2 minutes about to search around.
Use them links above to that Slugsnack provided, seen as though he's given them to you.
~Psych |
|
| Back to top |
|
 |
DJpieslice Newbie cheater
Reputation: 0
Joined: 19 Jul 2007 Posts: 16
|
Posted: Tue May 06, 2008 6:10 am Post subject: |
|
|
Thank you very much =)
And, I will post VB-related topics in the general programming section from now on. |
|
| Back to top |
|
 |
|