Ejemplo n.º 1
0
        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);
            }
        }
Ejemplo n.º 2
0
 public static bool IsKeyLocked(MemoryApi.KeyCode vk)
 {
     return((((ushort)MemoryApi.GetKeyState((int)vk)) & 0xffff) != 0);
 }
Ejemplo n.º 3
0
 public static bool IsKeyPushedDown(MemoryApi.KeyCode vKey)
 {
     return(0 != (MemoryApi.GetAsyncKeyState((int)vKey) & 0x8000));
 }
Ejemplo n.º 4
0
 public static void HumanKeyPress(MemoryApi.KeyCode vk)
 {
     PressKey(vk, true);
     Thread.Sleep(Utils.getRandom(100, 300));
     PressKey(vk, false);
 }