コード例 #1
0
        private List <KeyInfo> GetKeyboardKeys(KeyStroke keyStroke)
        {
            var  output    = new List <KeyInfo>();
            var  corrected = KeysHelper.GetCorrectedKey(keyStroke.Code, keyStroke.State);
            bool isDown    = keyStroke.State == KeyState.Down || keyStroke.State == (KeyState.Down | KeyState.E0);

            output.Add(new KeyInfo(corrected, isDown));

            return(output);
        }
コード例 #2
0
ファイル: Input.cs プロジェクト: karnp1991/Interceptor
        public void SendKey(Keys key, KeyState state)
        {
            Stroke stroke = new Stroke();
            KeyStroke keyStroke = new KeyStroke();

            keyStroke.Code = key;
            keyStroke.State = state;

            stroke.Key = keyStroke;

            InterceptionDriver.Send(context, deviceId, ref stroke, 1);

            if (KeyPressDelay > 0)
                Thread.Sleep(KeyPressDelay);
        }
コード例 #3
0
        internal void SendKey(InterceptionKey key, KeyState state)
        {
            Stroke    stroke    = new Stroke();
            KeyStroke keyStroke = new KeyStroke();

            keyStroke.Code  = key;
            keyStroke.State = state;

            stroke.Key = keyStroke;

            this.Send(this.context, this.deviceId, ref stroke, 1);

            if (this.KeyPressDelay > 0)
            {
                Thread.Sleep(this.KeyPressDelay);
            }
        }
コード例 #4
0
ファイル: Input.cs プロジェクト: PaxtonKuna/Interceptor
        public void SendKey(Keys key, KeyState state)
        {
            Stroke    stroke    = new Stroke();
            KeyStroke keyStroke = new KeyStroke();

            keyStroke.Code  = key;
            keyStroke.State = state;

            stroke.Key = keyStroke;

            Console.WriteLine("SendKey Device ID: {0}", deviceId);
            InterceptionDriver.Send(context, deviceId, ref stroke, 1);

            if (KeyPressDelay > 0)
            {
                Thread.Sleep(KeyPressDelay);
            }
        }
コード例 #5
0
        public void SendKey(InterceptionKeys key, KeyState state, int device)
        {
            Stroke    stroke    = new Stroke();
            KeyStroke keyStroke = new KeyStroke
            {
                Code  = key,
                State = state
            };

            stroke.Key = keyStroke;

            InterceptionDriver.Send(Context, device, ref stroke, 1);

            if (KeyPressDelay > 0)
            {
                Thread.Sleep(KeyPressDelay);
            }
        }
コード例 #6
0
        public void SendKey(Keys key, KeyState state)
        {
            Stroke    stroke    = new Stroke();
            KeyStroke keyStroke = new KeyStroke();

            keyStroke.Code  = key;
            keyStroke.State = state;

            stroke.Key = keyStroke;

            InterceptionDriver.Send(context, keyboardDeviceId, ref stroke, 1);
            this.debug("Send key " + key.ToString() + " " + state.ToString() + " for device id " + keyboardDeviceId);


            if (KeyPressDelay > 0)
            {
                Thread.Sleep(KeyPressDelay);
            }
        }
コード例 #7
0
ファイル: Input.cs プロジェクト: jasonpang/Interceptor
        public void SendKey(Keys key, KeyState state)
        {
            Stroke stroke = new Stroke();
            KeyStroke keyStroke = new KeyStroke();

            keyStroke.Code = key;
            keyStroke.State = state;

            stroke.Key = keyStroke;

            InterceptionDriver.Send(context, deviceId, ref stroke, 1);

            if (KeyPressDelay > 0)
                Thread.Sleep(KeyPressDelay);
        }
コード例 #8
0
ファイル: Input.cs プロジェクト: Tirael/Interceptor
        public void SendKeys(params Keys[] keys)
        {
            Stroke stroke = new Stroke();
            KeyStroke keyStroke = new KeyStroke();

            foreach (Keys key in keys)
            {
                keyStroke.Code = key;
                keyStroke.State = 0;

                stroke.Key = keyStroke;

                InterceptionDriver.Send(context, 1, ref stroke, 1);
            }

            foreach (Keys key in keys)
            {
                keyStroke.Code = key;
                keyStroke.State = KeyState.Up;

                stroke.Key = keyStroke;

                InterceptionDriver.Send(context, 1, ref stroke, 1);
            }
        }
コード例 #9
0
ファイル: Input.cs プロジェクト: Tirael/Interceptor
        public void SendKey(Keys key)
        {
            Stroke stroke = new Stroke();
            KeyStroke keyStroke = new KeyStroke();

            keyStroke.Code = key;
            keyStroke.State = KeyState.Down;

            stroke.Key = keyStroke;

            InterceptionDriver.Send(context, 1, ref stroke, 1);

            stroke.Key.State = KeyState.Up;
            InterceptionDriver.Send(context, 1, ref stroke, 1);
        }
コード例 #10
0
ファイル: Input.cs プロジェクト: Tirael/Interceptor
        public void SendKey(Keys key, KeyState state)
        {
            Stroke stroke = new Stroke();
            KeyStroke keyStroke = new KeyStroke();

            keyStroke.Code = key;
            keyStroke.State = state;

            stroke.Key = keyStroke;

            InterceptionDriver.Send(context, 1, ref stroke, 1);
        }