Ejemplo n.º 1
0
        public static void SendScanCode(ushort scanCode)
        {
            var ki = new KEYBDINPUT
            {
                wScan   = scanCode,
                dwFlags = KEYEVENTF.SCANCODE,
            };

            SendKeyboardInput(ki);
        }
Ejemplo n.º 2
0
        static INPUT[] ToInputsForUnicode(char c)
        {
            var ki_down = new KEYBDINPUT
            {
                wScan   = c,
                dwFlags = KEYEVENTF.UNICODE,
            };
            var ki_up = new KEYBDINPUT
            {
                wScan   = c,
                dwFlags = KEYEVENTF.UNICODE | KEYEVENTF.KEYUP,
            };

            return(new[] { ToInput(ki_down), ToInput(ki_up) });
        }
Ejemplo n.º 3
0
 static void SendKeyboardInput(KEYBDINPUT ki)
 {
     NativeKeyboardMouse.SendInput(new[] { ToInput(ki) });
 }