*EDIT* Easyer way of saying it:
How do you make it so when somethign in a list is selected and F1 is pressed it does soemthing every milisecond and when you press F1 again it stops. Help please.
Printable View
*EDIT* Easyer way of saying it:
How do you make it so when somethign in a list is selected and F1 is pressed it does soemthing every milisecond and when you press F1 again it stops. Help please.
You can't really do anything that quickly. Maybe 50 milliseconds would be more realistice. What are you trying to do?
Im trying make an autoclicker that clicks FAST, but if u cant do 1 every milisecond 50 is ok too, think you can help?
VB Code:
Option Explicit Dim intPressed As Integer Private Sub List1_KeyDown(KeyCode As Integer, Shift As Integer) If intPressed = 0 Then If KeyCode = vbKeyF1 Then intPressed = intPressed + 1 MsgBox "pressed! :)" End If Else: intPressed = 1 If KeyCode = vbKeyF1 Then intPressed = intPressed - 1 MsgBox "PRESSED! ;)" End If End If End Sub
That will do something when F1 is press, then do something else when pressed again.
-Sir Loin
What do you want to do when F1 is pressed? Is it your program, or are you accessing another program?
Hi,
This may help...
Have a good one!VB Code:
Option Explicit Dim AutoClick As Boolean Private Sub Form_Load() With List1 .AddItem "AutoClick" End With End Sub Private Sub List1_KeyDown(KeyCode As Integer, Shift As Integer) Select Case KeyCode Case vbKeyF1 If List1.ListIndex <> -1 Then AutoClick = Not AutoClick Timer1.Interval = 50 Timer1.Enabled = True End If End Select End Sub Private Sub Timer1_Timer() Static Cnt As Long If AutoClick Then Cnt = Cnt + 1 Debug.Print Cnt Else Timer1.Enabled = False End If DoEvents End Sub
BK
didne work only pressed! no PRESSED!
All that do is count it doesnt click.. where do i put vbKeyLButton ?Quote:
Originally Posted by Black__Knight
You mean it will automatically click L? Try to put it here..
VB Code:
Private Sub Timer1_Timer() Static Cnt As Long If AutoClick Then Cnt = Cnt + 1 [B]SendKeys "L"[/B] Else Timer1.Enabled = False End If DoEvents End Sub
No for vbkeycode lbutton is left click i want it to left click...
This might help.
Never mind, Resolved..