diff --git a/KVMSettingsForm.cs b/KVMSettingsForm.cs index a413f01..9e10a5d 100644 --- a/KVMSettingsForm.cs +++ b/KVMSettingsForm.cs @@ -21,7 +21,7 @@ namespace MeshCentralRouter { public partial class KVMSettingsForm : Form { - public KVMSettingsForm() + public KVMSettingsForm(int features2) { InitializeComponent(); Translate.TranslateControl(this); @@ -51,6 +51,10 @@ namespace MeshCentralRouter qualityComboBox.SelectedIndex = 4; scalingComboBox.SelectedIndex = 0; frameRateComboBox.SelectedIndex = 1; + if ((features2 & 0x1000) != 0) { + this.Height -= (autoSendClipboardCheckBox.Top - remoteKeyboardMapCheckBox.Top); + autoSendClipboardCheckBox.Visible = false; + } } private class DropListItem diff --git a/KVMViewer.cs b/KVMViewer.cs index d8519c2..0233f7d 100644 --- a/KVMViewer.cs +++ b/KVMViewer.cs @@ -358,8 +358,16 @@ namespace MeshCentralRouter } cadButton.Enabled = (state == 3); - clipInboundButton.Visible = !kvmControl.AutoSendClipboard; - clipOutboundButton.Visible = !kvmControl.AutoSendClipboard; + if ((kvmControl.AutoSendClipboard) && ((server.features2 & 0x1000) == 0)) // 0x1000 Clipboard Set + { + clipInboundButton.Visible = false; + clipOutboundButton.Visible = false; + } + else + { + clipInboundButton.Visible = ((server.features2 & 0x0800) == 0); // 0x0800 Clipboard Get + clipOutboundButton.Visible = ((server.features2 & 0x1000) == 0); // 0x1000 Clipboard Set + } clipInboundButton.Enabled = (state == 3); clipOutboundButton.Enabled = (state == 3); } @@ -402,7 +410,7 @@ namespace MeshCentralRouter private void settingsToolStripMenuItem_Click(object sender, EventArgs e) { if (kvmControl == null) return; - using (KVMSettingsForm form = new KVMSettingsForm()) + using (KVMSettingsForm form = new KVMSettingsForm(server.features2)) { form.Compression = kvmControl.CompressionLevel; form.Scaling = kvmControl.ScalingLevel; diff --git a/MeshCentralServer.cs b/MeshCentralServer.cs index 60958a6..3e40085 100644 --- a/MeshCentralServer.cs +++ b/MeshCentralServer.cs @@ -67,6 +67,8 @@ namespace MeshCentralRouter public Dictionary userRights = null; public Dictionary userGroups = null; private JavaScriptSerializer JSON = new JavaScriptSerializer(); + public int features = 0; // Bit flags of server features + public int features2 = 0; // Bit flags of server features // Mesh Rights /* @@ -237,6 +239,12 @@ namespace MeshCentralRouter } case "serverinfo": { + // Get the bit flags of server features + Dictionary serverinfo = (Dictionary)jsonAction["serverinfo"]; + if (serverinfo.ContainsKey("features") && (serverinfo["features"].GetType() == typeof(int))) { features = (int)serverinfo["features"]; } + if (serverinfo.ContainsKey("features2") && (serverinfo["features2"].GetType() == typeof(int))) { features2 = (int)serverinfo["features2"]; } + + // Ask for a lot of things from the server wc.WriteStringWebSocket("{\"action\":\"usergroups\"}"); wc.WriteStringWebSocket("{\"action\":\"meshes\"}"); wc.WriteStringWebSocket("{\"action\":\"nodes\"}");