Why doesn't this keyboard button simulation work in games?

  • Thread starter Thread starter Saulius LT
  • Start date Start date
S

Saulius LT

Guest
This keyboard key simulation works in Notepad.

Why doesn't this keyboard button simulation work in games?

Const vk_forward As UInteger = &H57 'w
<DllImport("user32.dll")>
Private Shared Sub keybd_event(ByVal bVk As Byte, ByVal bScan As Byte, ByVal dwFlags As UInteger, ByVal dwExtraInfo As Integer)
End Sub

Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
If Keyboard.IsKeyDown(System.Windows.Input.Key.LeftShift) = True Then keybd_event(vk_forward, 0, 0, 0)

End Sub

Continue reading...
 
Back
Top