the sendkeys thing for me when i was doing caps used to freeze mine. i would suggest using my code above to toggle the key press down and up
i think this should be it for you: (combination of yours and mine)
im not 100% about this but some more experience guys may be able to clean it up a littleCode:Imports System Imports System.IO Imports Microsoft.VisualBasic Public Class Form1 Private Declare Sub keybd_event Lib "user32" (ByVal bVk As Byte, ByVal bScan As Byte, ByVal dwFlags As Integer, ByVal dwExtraInfo As Integer) Private Sub CheckBox1_CheckedChanged(sender As Object, e As EventArgs) Handles CheckBox1.CheckedChanged Dim X As Integer X = 1 If CheckBox1.Checked Then Do While X = 1 Call keybd_event(System.Windows.Forms.Keys.W, 1, 0) Threading.Thread.Sleep(25) Loop End If End Sub End Class
good luck




Reply With Quote
