[DllImport("user32.dll", SetLastError = true)] static extern void keybd_event(byte bVk, byte bScan, int dwFlags, int dwExtraInfo); public const int KEYEVENTF_KEYUP = 0x02; public const int VK_W = 0x57; private void timer1_Tick(object sender, EventArgs e) { keybd_event(VK_W, 0, 0, 0); // keybd_event(VK_W, 0, KEYEVENTF_KEYUP, 0); }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)