I want to simulate keystrokes like I did with mouse clicks and I happened to find some example code online.
Declaration
Public Const MOUSEEVENTF_LEFTDOWN = &H2
Public Const MOUSEEVENTF_LEFTUP = &H4
Declare Function apimouse_event Lib "user32.dll" Alias "mouse_event" (ByVal dwFlags As Int32, ByVal dX As Int32, ByVal dY As Int32, ByVal cButtons As Int32, ByVal dwExtraInfo As Int32) As Boolean
Simulating MouseClicks
Call apimouse_event(MOUSEEVENTF_LEFTDOWN, 0, 0, 0, 0)
Call apimouse_event(MOUSEEVENTF_LEFTUP, 0, 0, 0, 0)
The above code can simulate mouse clicks even in directx application. Is there a similar way to simulate keystrokes as well? It would also be great if you can explain what the above code does since I don't quite understand it.