1
0
mirror of https://github.com/Ylianst/MeshCentralRouter synced 2025-12-15 07:43:38 +00:00

Minor fix in case agent does not support remote desktop.

This commit is contained in:
Ylian Saint-Hilaire
2020-11-27 14:27:24 -08:00
parent 9812e8c67f
commit ba20ab746c
3 changed files with 21 additions and 24 deletions

View File

@@ -144,14 +144,7 @@ namespace MeshCentralRouter
{ {
isHookWanted = false; isHookWanted = false;
} }
if (Settings.GetRegValue("Exp_KeyboardHookPriority", false)) isHookPriority = Settings.GetRegValue("Exp_KeyboardHookPriority", false);
{
isHookPriority = true;
}
else
{
isHookPriority = false;
}
} }
public void AttachKeyboard() public void AttachKeyboard()
@@ -418,7 +411,8 @@ namespace MeshCentralRouter
if (remoteKeybaordMap == true) return; if (remoteKeybaordMap == true) return;
if (killNextKeyPress > 0) { if (killNextKeyPress > 0)
{
long t = DateTime.Now.Ticks; long t = DateTime.Now.Ticks;
if ((t - killNextKeyPress) < 10) { killNextKeyPress = 0; return; } if ((t - killNextKeyPress) < 10) { killNextKeyPress = 0; return; }
} }
@@ -631,7 +625,8 @@ namespace MeshCentralRouter
private void KVMControl_MouseMove(object sender, MouseEventArgs e) private void KVMControl_MouseMove(object sender, MouseEventArgs e)
{ {
long ct = DateTime.Now.Ticks; long ct = DateTime.Now.Ticks;
if ((lastMouseMove + 30) < ct) { if ((lastMouseMove + 30) < ct)
{
lastMouseMove = ct; lastMouseMove = ct;
SendMouse(e, 0); SendMouse(e, 0);
} }

View File

@@ -203,7 +203,7 @@ namespace MeshCentralRouter
case "metadata": case "metadata":
{ {
if ((jsonAction.ContainsKey("users") == false) || (jsonAction["users"] == null)) return; if ((jsonAction.ContainsKey("users") == false) || (jsonAction["users"] == null)) return;
Dictionary <string, object> usersex = (Dictionary<string, object>)jsonAction["users"]; Dictionary<string, object> usersex = (Dictionary<string, object>)jsonAction["users"];
userSessions = new Dictionary<string, int>(); userSessions = new Dictionary<string, int>();
foreach (string user in usersex.Keys) { userSessions.Add(user, (int)usersex[user]); } foreach (string user in usersex.Keys) { userSessions.Add(user, (int)usersex[user]); }
UpdateStatus(); UpdateStatus();
@@ -475,7 +475,8 @@ namespace MeshCentralRouter
{ {
kvmStats = new KVMStats(this); kvmStats = new KVMStats(this);
kvmStats.Show(this); kvmStats.Show(this);
} else }
else
{ {
kvmStats.Focus(); kvmStats.Focus();
} }

View File

@@ -1666,6 +1666,7 @@ namespace MeshCentralRouter
if (devicesListView.SelectedItems.Count != 1) { return; } if (devicesListView.SelectedItems.Count != 1) { return; }
ListViewItem selecteditem = devicesListView.SelectedItems[0]; ListViewItem selecteditem = devicesListView.SelectedItems[0];
NodeClass node = (NodeClass)selecteditem.Tag; NodeClass node = (NodeClass)selecteditem.Tag;
if ((node.agentcaps & 1) == 0) { return; } // Agent does not support remote desktop
if ((node.conn & 1) == 0) { return; } // Agent not connected on this device if ((node.conn & 1) == 0) { return; } // Agent not connected on this device
if (node.desktopViewer == null) if (node.desktopViewer == null)
{ {