From 6c70c291b6ccb90d16ebd504dd8610b80ff015e4 Mon Sep 17 00:00:00 2001 From: Ylian Saint-Hilaire Date: Thu, 14 Jul 2022 14:08:47 -0700 Subject: [PATCH] Fixed double backspace when doing remote desktop. --- src/KVMControl.cs | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/src/KVMControl.cs b/src/KVMControl.cs index 14278ce..b21dfdc 100644 --- a/src/KVMControl.cs +++ b/src/KVMControl.cs @@ -564,15 +564,9 @@ namespace MeshCentralRouter if ((t - killNextKeyPress) < 10) { killNextKeyPress = 0; return; } } + // I am not sure why keys below 32 can't be sent using unicode, but sending 8 (backspace) with SendKey() results is two backspaces, so not a good thing. ushort c = (ushort)e.KeyChar; - if (c < 32) - { - SendKey((byte)c, 0); - } - else - { - SendUnicodeKey(c, 0); - } + if ((c < 32) && (c != 8)) { SendKey((byte)c, 0); } else { SendUnicodeKey(c, 0); } } private void SendKey(KeyEventArgs e, byte action)