コード例 #1
0
ファイル: VKeyboard.cs プロジェクト: neapolis/SambaPOS-3
        public void ReleaseKey(Keys keyCode)
        {
            var structInput = new INPUT();
            structInput.type = 1;
            structInput.ki.wScan = 0;
            structInput.ki.time = 0;
            structInput.ki.dwFlags = 0;
            structInput.ki.dwExtraInfo = 0;

            // Key up the actual key-code
            structInput.ki.dwFlags = NativeWin32.KEYEVENTF_KEYUP;
            structInput.ki.wVk = (ushort)keyCode;// (ushort)NativeWin32.VK.SNAPSHOT;//vk;
            NativeWin32.SendInput(1, ref structInput, Marshal.SizeOf(structInput));
        }
コード例 #2
0
ファイル: NativeWin32.cs プロジェクト: GHLabs/SambaPOS-3
 public static extern uint SendInput(uint nInputs, ref INPUT pInputs, int cbSize);
コード例 #3
0
ファイル: VKeyboard.cs プロジェクト: neapolis/SambaPOS-3
        public void PressKey(Keys keyCode)
        {
            var structInput = new INPUT();
            structInput.type = 1;
            structInput.ki.wScan = 0;
            structInput.ki.time = 0;
            structInput.ki.dwFlags = 0;
            structInput.ki.dwExtraInfo = 0;
            // Key down the actual key-code

            structInput.ki.wVk = (ushort)keyCode; //VK.SHIFT etc.
            NativeWin32.SendInput(1, ref structInput, Marshal.SizeOf(structInput));
        }