Help with hotkeys GetAsyncKeyState
Hey everyone I don't have much to say other then I'm making a trainer in Vb.Net everything works perfect! except I'm fed up of using buttons
to turn on and off the hacks. I'm trying to use GetAsyncKeyState to use hotkeys but I only succeed in turning on the hack.
Is it possible for somebody too show me an example of turning on and turning off.
__________________________________________________ ____________
EDITED:
Okay I will give you what I got so far.
Public Class Form1
#Region "Declarations"
Public Declare Function GetKeyPress Lib "user32" Alias "GetAsyncKeyState" (ByVal key As Integer) As Integer
Private Declare Function GetAsyncKeyState Lib "user32" (ByVal vkey As Integer) As Short
#End Region
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
hotkey.Start()
End Sub
Private Sub Timer1_Tick(sender As Object, e As EventArgs) Handles hotkey.Tick
Dim hotkey1 As Boolean
hotkey1 = GetAsyncKeyState(Keys.NumPad1)
If hotkey1 = True Then
Label1.Text = "Turned: ON"
' Enter action here
End If
End Sub
i want to toggle on and off
to turn on and off the hacks. I'm trying to use GetAsyncKeyState to use hotkeys but I only succeed in turning on the hack.
Is it possible for somebody too show me an example of turning on and turning off.
__________________________________________________ ____________
EDITED:
Okay I will give you what I got so far.
Public Class Form1
#Region "Declarations"
Public Declare Function GetKeyPress Lib "user32" Alias "GetAsyncKeyState" (ByVal key As Integer) As Integer
Private Declare Function GetAsyncKeyState Lib "user32" (ByVal vkey As Integer) As Short
#End Region
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
hotkey.Start()
End Sub
Private Sub Timer1_Tick(sender As Object, e As EventArgs) Handles hotkey.Tick
Dim hotkey1 As Boolean
hotkey1 = GetAsyncKeyState(Keys.NumPad1)
If hotkey1 = True Then
Label1.Text = "Turned: ON"
' Enter action here
End If
End Sub
i want to toggle on and off
