public static void PressKey(MemoryApi.KeyCode vk, bool press) { var lowOrderByte = (ushort)((ushort)vk & 0xff); var scanCode = (ushort)MemoryApi.MapVirtualKey(lowOrderByte, 0); //Console.WriteLine("SendInput:: VK: " + (ushort)vk + " (" + vk + ") <-> SC: " + (ushort)(scanCode & 0xff)); if (press) { KeyDown(scanCode); } else { KeyUp(scanCode); } }
public static bool IsKeyLocked(MemoryApi.KeyCode vk) { return((((ushort)MemoryApi.GetKeyState((int)vk)) & 0xffff) != 0); }
public static bool IsKeyPushedDown(MemoryApi.KeyCode vKey) { return(0 != (MemoryApi.GetAsyncKeyState((int)vKey) & 0x8000)); }
public static void HumanKeyPress(MemoryApi.KeyCode vk) { PressKey(vk, true); Thread.Sleep(Utils.getRandom(100, 300)); PressKey(vk, false); }