Exemplo n.º 1
0
        /// <summary>
        /// Sends a pointer event to the VNC server to indicate mouse motion, a button click, etc.
        /// </summary>
        /// <param name="x">The X coordinate of the mouse.</param>
        /// <param name="y">The Y coordinate of the mouse.</param>
        /// <param name="pressedButtons">
        ///     A bit mask of pressed mouse buttons, in X11 convention: 1 is left, 2 is middle, and 4 is right.
        ///     Mouse wheel scrolling is treated as a button event: 8 for up and 16 for down.
        /// </param>
        public void SendPointerEvent(int x, int y, int pressedButtons)
        {
            var p = new byte[6];

            p[0] = (byte)5;
            p[1] = (byte)pressedButtons;
            VncUtility.EncodeUInt16BE(p, 2, (ushort)x);
            VncUtility.EncodeUInt16BE(p, 4, (ushort)y);

            if (this.IsConnected)
            {
                this.c.Send(p);
            }
        }
Exemplo n.º 2
0
 /// <summary>
 /// Writes a <see cref="ushort"/> in big endian encoding to the current position in the stream and advances the position within the stream by two bytes.
 /// </summary>
 /// <param name="value">
 /// The <see cref="ushort"/> to write to the stream.
 /// </param>
 public void SendUInt16BE(ushort value)
 {
     this.Send(VncUtility.EncodeUInt16BE(value));
 }