public void SendKeyEvent(KeySym keysym, bool pressed) { var p = new byte[8]; p[0] = (byte)4; p[1] = (byte)(pressed ? 1 : 0); VncUtility.EncodeUInt32BE(p, 4, (uint)keysym); if (this.IsConnected) { this.c.Send(p); } }
/// <summary> /// Notifies the server that the local clipboard has changed. /// If you are implementing clipboard integration, use this to set the remote clipboard. /// </summary> /// <param name="data">The contents of the local clipboard.</param> public void SendLocalClipboardChange(string data) { Throw.If.Null(data, "data"); var bytes = VncStream.EncodeString(data); var p = new byte[8 + bytes.Length]; p[0] = (byte)6; VncUtility.EncodeUInt32BE(p, 4, (uint)bytes.Length); Array.Copy(bytes, 0, p, 8, bytes.Length); if (this.IsConnected) { this.c.Send(p); } }
/// <summary> /// Writes a <see cref="uint"/> in big endian encoding to the current position in the stream and advances the position within the stream by four bytes. /// </summary> /// <param name="value"> /// The <see cref="uint"/> to write to the stream. /// </param> public void SendUInt32BE(uint value) { this.Send(VncUtility.EncodeUInt32BE(value)); }