Bueno amigo partiendo de tucodigo y algo que encontre en google este seria el Programa final:
Código vb:
Ver originalOption Explicit
Private Const constKeyDown = -32767
Private Type POINTAPI
X As Long
Y As Long
End Type
Private Declare Sub mouse_event Lib "user32" (ByVal dwFlags As Long, ByVal dx As Long, ByVal dy As Long, ByVal cButtons As Long, ByVal dwExtraInfo As Long)
Private Const MOUSEEVENTF_LEFTDOWN = &H2
Private Const MOUSEEVENTF_LEFTUP = &H4
Private Const MOUSEEVENTF_MIDDLEDOWN = &H20
Private Const MOUSEEVENTF_MIDDLEUP = &H40
Private Const MOUSEEVENTF_MOVE = &H1
Private Const MOUSEEVENTF_RIGHTDOWN = &H8
Private Const MOUSEEVENTF_RIGHTUP = &H10
Private Declare Function GetAsyncKeyState Lib "user32" (ByVal vKey As Long) As Integer
Private Declare Function GetCursorPos Lib "user32" (lpPoint As POINTAPI) As Long
Private Declare Function SetCursorPos Lib "user32" (ByVal X As Long, ByVal Y As Long) As Long
Private Sub Form_Load()
Timer1.Interval = 50
Timer1.Enabled = True
'Me.Hide
End Sub
Private Sub Timer1_Timer()
Dim Point As POINTAPI
If GetAsyncKeyState(40) <= constKeyDown Then
'MsgBox ("Abajo")
GetCursorPos Point
SetCursorPos Point.X, Point.Y + 10
End If
If GetAsyncKeyState(38) <= constKeyDown Then
'MsgBox ("Arriba")
GetCursorPos Point
SetCursorPos Point.X, Point.Y - 10
End If
If GetAsyncKeyState(37) <= constKeyDown Then
'MsgBox ("Izquierda")
GetCursorPos Point
SetCursorPos Point.X - 10, Point.Y
End If
If GetAsyncKeyState(39) <= constKeyDown Then
'MsgBox ("Derecha")
GetCursorPos Point
SetCursorPos Point.X + 10, Point.Y
End If
If GetAsyncKeyState(13) <= constKeyDown Then
'MsgBox ("Enter")
mouse_event MOUSEEVENTF_LEFTDOWN, 0, 0, 0, 0
mouse_event MOUSEEVENTF_LEFTUP, 0, 0, 0, 0
End If
If GetAsyncKeyState(32) <= constKeyDown Then
'MsgBox ("Espacio")
mouse_event MOUSEEVENTF_RIGHTDOWN, 0, 0, 0, 0
mouse_event MOUSEEVENTF_RIGHTUP, 0, 0, 0, 0
End If
End Sub
Lo unico que faltaria es hacerle Hide al Form para que quedara oculto...
o no se si habra una forma de que se coloque en la barra de tareas (como la Hora o los iconos del Antivirus..)
pero ya basicamente hace lo que buscaba..
Ah yo use ENTER y ESPACIO como CLIC y RightClic