Skip to content

Commit

Permalink
Merge pull request #59 from sschoen/202303
Browse files Browse the repository at this point in the history
different bug fixes
  • Loading branch information
Ylianst authored Oct 7, 2023
2 parents f049ff6 + 4aadc7e commit fde77c0
Show file tree
Hide file tree
Showing 9 changed files with 148 additions and 91 deletions.
3 changes: 2 additions & 1 deletion src/FileViewer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1413,7 +1413,8 @@ private void closeTransferDialog()
transferStatusForm.transferCompleted();
}

remoteFolder = strDownloadRel; // Zurücksetzen
if (downloadActive)
remoteFolder = strDownloadRel; // Zurücksetzen
remoteRefresh();
}

Expand Down
13 changes: 12 additions & 1 deletion src/KVMControl.cs
Original file line number Diff line number Diff line change
Expand Up @@ -568,13 +568,24 @@ private void SendPress(KeyPressEventArgs e, byte action)
if (c >= 32) { SendUnicodeKey(c, 0); }
}

private static readonly Keys[] ignoreKeys = {
// 0-9 (KeyCode: 48-57)
Keys.D0, Keys.D1, Keys.D2, Keys.D3, Keys.D4, Keys.D5, Keys.D6, Keys.D7, Keys.D8, Keys.D9,
// NumPad 0-9 (KeyCode: 96-105)
Keys.NumPad0, Keys.NumPad1, Keys.NumPad2, Keys.NumPad3, Keys.NumPad4, Keys.NumPad5, Keys.NumPad6, Keys.NumPad7, Keys.NumPad8, Keys.NumPad9,
// Special-Keys
Keys.Space, Keys.Divide, Keys.Multiply, Keys.Subtract, Keys.Add, Keys.Decimal,
// Oem-Keys
Keys.Oem1, Keys.Oem2, Keys.Oem3, Keys.Oem4, Keys.Oem5, Keys.Oem6, Keys.Oem7, Keys.Oem8, Keys.Oem102, Keys.OemSemicolon, Keys.Oemplus, Keys.Oemcomma,
Keys.OemMinus, Keys.OemPeriod, Keys.OemQuestion, Keys.Oemtilde, Keys.OemOpenBrackets, Keys.OemPipe, Keys.OemCloseBrackets, Keys.OemQuotes
};
private void SendKey(KeyEventArgs e, byte action)
{
//if (state != ConnectState.Connected) return;

if (remoteKeyboardMap == true) { SendKey((byte)e.KeyCode, action); return; } // Use old key system that uses the remote keyboard mapping.
string keycode = e.KeyCode.ToString();
if ((action == 0) && (e.Control == false) && (e.Alt == false) && (((e.KeyValue >= 48) && (e.KeyValue <= 57))|| ((e.KeyValue >= 96) && (e.KeyValue <= 105)) || (keycode.Length == 1) || (keycode.StartsWith("Oem") == true))) return;
if ((action == 0) && (e.Control == false) && (e.Alt == false) && (Array.IndexOf(ignoreKeys, e.KeyCode) > -1 || (keycode.Length == 1))) return;
if ((e.Control == true) || (e.Alt == true)) { killNextKeyPress = DateTime.Now.Ticks; }
SendKey((byte)e.KeyCode, action);
e.Handled = true;
Expand Down
11 changes: 11 additions & 0 deletions src/KVMViewer.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 15 additions & 0 deletions src/KVMViewer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -397,6 +397,7 @@ private void UpdateStatus()
}

cadButton.Enabled = (state == 3);
openRemoteFilesButton.Enabled = (state == 3 && (node.agentcaps & 4) != 0);
if ((kvmControl.AutoSendClipboard) && ((server.features2 & 0x1000) == 0)) // 0x1000 Clipboard Set
{
clipInboundButton.Visible = false;
Expand Down Expand Up @@ -755,6 +756,20 @@ private void splitButton_Click(object sender, EventArgs e)
}
}

private void openRemoteFilesButton_Click(object sender, EventArgs e)
{
if ((node.conn & 1) == 0) { return; } // Agent not connected on this device

if (node.fileViewer == null)
{
node.fileViewer = new FileViewer(server, node);
node.fileViewer.Show();
node.fileViewer.MenuItemConnect_Click(null, null);
}
else
{
node.fileViewer.Focus();
}
}
}
}
Loading

0 comments on commit fde77c0

Please sign in to comment.