private INPUT CreateInputKey(KeysEx keyCode, KEYBDINPUT_FLAGS dwFlags)
 {
     return(new INPUT()
     {
         type = INPUT_TYPE.INPUT_KEYBOARD,
         u = new InputUnion
         {
             ki = new KEYBDINPUT
             {
                 wVk = (System.UInt16)keyCode,
                 wScan = 0,
                 dwFlags = dwFlags,
                 dwExtraInfo = NativeWin32.GetMessageExtraInfo()
             }
         }
     });
 }
 private uint SendInputs(INPUT[] inputs)
 {
     System.UInt32 ret = NativeWin32.SendInput((System.UInt32)inputs.Length, inputs, Marshal.SizeOf(typeof(INPUT)));
     return(ret == inputs.Length ? ret : NativeWin32.GetLastError());
 }