1
0
mirror of https://github.com/Ylianst/MeshCentralRouter synced 2025-12-10 05:13:39 +00:00

Fixed multi-display switch when non-english language.

This commit is contained in:
Ylian Saint-Hilaire
2021-06-25 14:02:37 -07:00
parent 5041fafd55
commit edd7b9d080
3 changed files with 60 additions and 51 deletions

View File

@@ -41,7 +41,7 @@ namespace MeshCentralRouter
private bool remoteKeyboardMap = false;
private bool autoSendClipboard = false;
private double scalefactor = 1;
public List<string> displays = new List<string>();
public List<ushort> displays = new List<ushort>();
public ushort currentDisp = 0;
public bool MouseButtonLeft = false;
public bool MouseButtonMiddle = false;
@@ -273,21 +273,7 @@ namespace MeshCentralRouter
int i = 0;
ushort length = (ushort)((buffer[off + 4] << 8) + buffer[off + 5]);
displays.Clear();
if (length > 0)
{
for (i = 0; i < length; i++)
{
ushort num = (ushort)((buffer[off + 6 + i * 2] << 8) + buffer[off + 7 + i * 2]);
if (num == 0xFFFF)
{
displays.Add(Translate.T(Properties.Resources.AllDisplays));
}
else
{
displays.Add(string.Format(Translate.T(Properties.Resources.DisplayX), num));
}
}
}
if (length > 0) { for (i = 0; i < length; i++) { displays.Add((ushort)((buffer[off + 6 + i * 2] << 8) + buffer[off + 7 + i * 2])); } }
currentDisp = (ushort)((buffer[off + 6 + i * 2] << 8) + buffer[off + 7 + i * 2]);
if (DisplaysReceived != null) DisplaysReceived(this, null);
break;