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); }
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); }
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); } }
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); } }
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); } }
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); } }
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); } }
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); }
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); }