Exemplo n.º 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);
        }
Exemplo n.º 2
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, deviceId, ref stroke, 1);

            if (KeyPressDelay > 0)
                Thread.Sleep(KeyPressDelay);
        }
Exemplo n.º 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);
            }
        }
Exemplo n.º 4
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;

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

            if (KeyPressDelay > 0)
            {
                Thread.Sleep(KeyPressDelay);
            }
        }
Exemplo n.º 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);
            }
        }
Exemplo n.º 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);
            }
        }
Exemplo n.º 7
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, deviceId, ref stroke, 1);

            if (KeyPressDelay > 0)
                Thread.Sleep(KeyPressDelay);
        }
Exemplo n.º 8
0
        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);
            }
        }
Exemplo n.º 9
0
        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);
        }
Exemplo n.º 10
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, 1, ref stroke, 1);
        }