I am making an external bhop for my friends that can't bhop. I personally use logitech gaming software for my macros bhop and I don't have trouble strafing. The code I have right now seems to detect mouse position just fine for strafing but I can't send key strokes to csgo because it won't accept sendkeys.send or keybd_event. My method of strafing is a little weird. When playing fps games every few miliseccond the game will set your courser back to the center of the screen. I detect strafe direction by checking if the mouse is on the left or right side of the screen which works really well.
So in conclusion CSGO wont accept/detect my "virtual keypress". Can anyone help me with ether a work around or some code. I have spent well over 5 hours looking for alternate key sending methods but I can't seem to find any. Also I want to do this completely external so its like a macro and wont need to hook into csgo.exe. Thanks
My Code:
Code:
Public Class Form1
Private Declare Function GetAsyncKeyState Lib "user32" (ByVal vkey As Integer) As Integer
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
'Hits Space Bar every 25 mil sec (Works Fine)(THis method of bhop works fantastic on flat surfaces)
Timer1.Interval = 25
'Checks which direction your mouse is moving ever 4 mil sec
Timer2.Interval = 4
End Sub
Private Sub Timer1_Tick(sender As Object, e As EventArgs) Handles Timer1.Tick
'Checks if space bar is down (Works Fine)
Dim hop As Boolean
hop = GetAsyncKeyState(32)
If hop = True Then
'I want it to press Space key Here
' I need help here CSGO ignors Senkeys.Send and keybd_event. How can I send key strokes to the game?
End If
End Sub
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
'Enables timers (Works Fine)
If Button1.Text = "ENABLE" Then
Timer1.Enabled = True
Timer2.Enabled = True
Button1.Text = "DISABLE"
Else
Timer1.Enabled = False
Timer2.Enabled = False
Button1.Text = "ENABLE"
End If
End Sub
Private Sub Timer2_Tick(sender As Object, e As EventArgs) Handles Timer2.Tick
'Checks if space bar is down (Works Fine)
Dim hop As Boolean
hop = GetAsyncKeyState(32)
'Checks if space bar is down (Works Fine) and if coursor is on left half of screen (When moving mouse in game your mouse coursor is reset to screen center every couple mil sec)
'these checks work for detecting the straifing but again, I cant send key strokes.
'IF your corsor is on the left half of the sc
If (Cursor.Position.X < (Screen.PrimaryScreen.Bounds.Width / 2)) And hop = True Then
'I want it to press A key Here
' I need help here CSGO ignors "Senkeys.Send" and "keybd_event". How can I send key strokes to the game?
ElseIf (Cursor.Position.X > (Screen.PrimaryScreen.Bounds.Width / 2)) And hop = True Then
'I want it to press D key Here
' I need help here CSGO ignors "Senkeys.Send" and "keybd_event". How can I send key strokes to the game?
End If
End Sub
End Class