Results 1 to 12 of 12

Thread: A little help with 6.0 please :) *Resolved...*

  1. #1

    Thread Starter
    New Member
    Join Date
    Jun 2005
    Posts
    15

    A little help with 6.0 please :) *Resolved...*

    *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.
    Last edited by SlipKnot; Jun 29th, 2005 at 11:10 PM. Reason: Easyer Way of Saying

  2. #2
    Banned dglienna's Avatar
    Join Date
    Jun 2004
    Location
    Center of it all
    Posts
    17,901

    Re: A little help with 6.0 please :)

    You can't really do anything that quickly. Maybe 50 milliseconds would be more realistice. What are you trying to do?

  3. #3

    Thread Starter
    New Member
    Join Date
    Jun 2005
    Posts
    15

    Re: A little help with 6.0 please :)

    Im trying make an autoclicker that clicks FAST, but if u cant do 1 every milisecond 50 is ok too, think you can help?

  4. #4
    Fanatic Member
    Join Date
    Mar 2005
    Posts
    537

    Re: A little help with 6.0 please :)

    VB Code:
    1. Option Explicit
    2. Dim intPressed As Integer
    3.  
    4. Private Sub List1_KeyDown(KeyCode As Integer, Shift As Integer)
    5.  
    6. If intPressed = 0 Then
    7.     If KeyCode = vbKeyF1 Then
    8.         intPressed = intPressed + 1
    9.         MsgBox "pressed! :)"
    10.     End If
    11. Else: intPressed = 1
    12.     If KeyCode = vbKeyF1 Then
    13.         intPressed = intPressed - 1
    14.         MsgBox "PRESSED! ;)"
    15.     End If
    16. End If
    17.  
    18. End Sub

    That will do something when F1 is press, then do something else when pressed again.

    -Sir Loin

  5. #5
    Banned dglienna's Avatar
    Join Date
    Jun 2004
    Location
    Center of it all
    Posts
    17,901

    Re: A little help with 6.0 please :)

    What do you want to do when F1 is pressed? Is it your program, or are you accessing another program?

  6. #6
    Addicted Member
    Join Date
    May 2005
    Posts
    168

    Re: A little help with 6.0 please :)

    Hi,

    This may help...

    VB Code:
    1. Option Explicit
    2. Dim AutoClick As Boolean
    3.  
    4. Private Sub Form_Load()
    5.     With List1
    6.         .AddItem "AutoClick"
    7.     End With
    8. End Sub
    9.  
    10. Private Sub List1_KeyDown(KeyCode As Integer, Shift As Integer)
    11.     Select Case KeyCode
    12.         Case vbKeyF1
    13.             If List1.ListIndex <> -1 Then
    14.                 AutoClick = Not AutoClick
    15.                 Timer1.Interval = 50
    16.                 Timer1.Enabled = True
    17.             End If
    18.     End Select
    19. End Sub
    20.  
    21. Private Sub Timer1_Timer()
    22.     Static Cnt As Long
    23.    
    24.     If AutoClick Then
    25.         Cnt = Cnt + 1
    26.         Debug.Print Cnt
    27.     Else
    28.         Timer1.Enabled = False
    29.     End If
    30.     DoEvents
    31. End Sub
    Have a good one!
    BK

  7. #7

    Thread Starter
    New Member
    Join Date
    Jun 2005
    Posts
    15

    Re: A little help with 6.0 please :)

    didne work only pressed! no PRESSED!

  8. #8

    Thread Starter
    New Member
    Join Date
    Jun 2005
    Posts
    15

    Re: A little help with 6.0 please :)

    Quote Originally Posted by Black__Knight
    Hi,

    This may help...

    VB Code:
    1. Option Explicit
    2. Dim AutoClick As Boolean
    3.  
    4. Private Sub Form_Load()
    5.     With List1
    6.         .AddItem "AutoClick"
    7.     End With
    8. End Sub
    9.  
    10. Private Sub List1_KeyDown(KeyCode As Integer, Shift As Integer)
    11.     Select Case KeyCode
    12.         Case vbKeyF1
    13.             If List1.ListIndex <> -1 Then
    14.                 AutoClick = Not AutoClick
    15.                 Timer1.Interval = 50
    16.                 Timer1.Enabled = True
    17.             End If
    18.     End Select
    19. End Sub
    20.  
    21. Private Sub Timer1_Timer()
    22.     Static Cnt As Long
    23.    
    24.     If AutoClick Then
    25.         Cnt = Cnt + 1
    26.         Debug.Print Cnt
    27.     Else
    28.         Timer1.Enabled = False
    29.     End If
    30.     DoEvents
    31. End Sub
    Have a good one!
    BK
    All that do is count it doesnt click.. where do i put vbKeyLButton ?

  9. #9
    Software Carpenter dee-u's Avatar
    Join Date
    Feb 2005
    Location
    Pinas
    Posts
    11,127

    Re: A little help with 6.0 please :)

    You mean it will automatically click L? Try to put it here..

    VB Code:
    1. Private Sub Timer1_Timer()
    2.     Static Cnt As Long
    3.     If AutoClick Then
    4.         Cnt = Cnt + 1
    5.         [B]SendKeys "L"[/B]
    6.     Else
    7.         Timer1.Enabled = False
    8.     End If
    9.     DoEvents
    10. End Sub
    Regards,


    As a gesture of gratitude please consider rating helpful posts. c",)

    Some stuffs: Mouse Hotkey | Compress file using SQL Server! | WPF - Rounded Combobox | WPF - Notify Icon and Balloon | NetVerser - a WPF chatting system

  10. #10

    Thread Starter
    New Member
    Join Date
    Jun 2005
    Posts
    15

    Re: A little help with 6.0 please :)

    No for vbkeycode lbutton is left click i want it to left click...

  11. #11
    Software Carpenter dee-u's Avatar
    Join Date
    Feb 2005
    Location
    Pinas
    Posts
    11,127

    Re: A little help with 6.0 please :) *Almost Done, Help*

    This might help.
    Regards,


    As a gesture of gratitude please consider rating helpful posts. c",)

    Some stuffs: Mouse Hotkey | Compress file using SQL Server! | WPF - Rounded Combobox | WPF - Notify Icon and Balloon | NetVerser - a WPF chatting system

  12. #12

    Thread Starter
    New Member
    Join Date
    Jun 2005
    Posts
    15

    Re: A little help with 6.0 please :) *RESOLVED*

    Never mind, Resolved..
    Last edited by SlipKnot; Jun 29th, 2005 at 11:02 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width