Exemplo n.º 1
0
    private void AddInput(VirtualKeyShort vk, ScanCodeShort sc)
    {
        INPUT tmp = new INPUT();
        tmp.type = EINPUT.KEYBOARD;
        tmp.U.ki.wVk = vk;
        tmp.U.ki.wScan = sc;
        tmp.U.ki.time = 0;
        tmp.U.ki.dwFlags = KEYEVENTF.UNICODE;
        tmp.U.ki.dwExtraInfo = UIntPtr.Zero;
        m_input.Add(tmp);

        tmp.U.ki.dwFlags |= KEYEVENTF.KEYUP;
        m_input.Add(tmp);
    }
Exemplo n.º 2
0
 private static INPUT NewInputKey()
 {
     INPUT ret = new INPUT();
     ret.type = EINPUT.KEYBOARD;
     ret.U.ki.wVk = (VirtualKeyShort)0;
     ret.U.ki.wScan = (ScanCodeShort)0;
     ret.U.ki.time = 0;
     ret.U.ki.dwFlags = KEYEVENTF.UNICODE;
     ret.U.ki.dwExtraInfo = UIntPtr.Zero;
     return ret;
 }