private void Window_KeyUp(object sender, KeyEventArgs e) { var command = new RemoteCommand(TypeCommand.KeyboardEvent, e.Convert()); sendData.Enqueue(command.SerializeData()); e.Handled = true; }
private void Window_KeyDown(object sender, KeyEventArgs e) { var command = new RemoteCommand(TypeCommand.KeyboardEvent, e.Convert()); sendData.Enqueue(command.SerializeData()); e.Handled = true; System.Diagnostics.Debug.WriteLine($"Key:{e.Key}"); }
protected override void OnMouseUp(MouseButtonEventArgs e) { base.OnMouseUp(e); Point p = e.GetPosition(this); Point pos = new Point(p.X / imageSource.Width, p.Y / imageSource.Height); var command = new RemoteCommand(TypeCommand.MouseButtons, e.Convert(pos)); sendData.Enqueue(command.SerializeData()); }
protected override void OnMouseMove(MouseEventArgs e) { base.OnMouseMove(e); var p = e.GetPosition(this); if (imageSource != null) { cursorPossition = new Point(p.X / imageSource.Width, p.Y / imageSource.Height); var command = new RemoteCommand(TypeCommand.MouseMove, cursorPossition); sendData.Enqueue(command.SerializeData()); } }