Esempio n. 1
0
        private void Window_KeyUp(object sender, KeyEventArgs e)
        {
            var command = new RemoteCommand(TypeCommand.KeyboardEvent, e.Convert());

            sendData.Enqueue(command.SerializeData());
            e.Handled = true;
        }
Esempio n. 2
0
        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}");
        }
Esempio n. 3
0
        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());
        }
Esempio n. 4
0
        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());
            }
        }