[MWB]Remove shortcut for deprecated VKMap functionality(#26484)

* Comment out code hooking Ctrl+Shift+Alt+K to toggle unused UseVKMap setting

* [MWB] Remove UseVKMap and VKMap completely

---------

Co-authored-by: David Taylor <davidt@yadt.co.uk>
This commit is contained in:
Andrey Nekrasov
2023-05-30 18:46:42 +02:00
committed by GitHub
parent b50b587a63
commit 4cc74da82f
7 changed files with 8 additions and 67 deletions

View File

@@ -356,15 +356,7 @@ namespace MouseWithoutBorders.Class
if (Common.DesMachineID == ID.NONE || Common.DesMachineID == ID.ALL || Common.DesMachineID == Common.MachineID)
{
if (nCode >= 0 && Setting.Values.UseVKMap && Setting.Values.VKMap != null && Setting.Values.VKMap.ContainsKey(hookCallbackKeybdData.wVk) && !CtrlDown)
{
InputSimulation.SendKey(hookCallbackKeybdData);
return 1;
}
else
{
return NativeMethods.CallNextHookEx(hKeyboardHook, nCode, wParam, lParam);
}
return NativeMethods.CallNextHookEx(hKeyboardHook, nCode, wParam, lParam);
}
else
{
@@ -645,14 +637,6 @@ namespace MouseWithoutBorders.Class
}
}
}
else if (shiftDown && Setting.Values.VKMap != null && vkCode == (Setting.Values.VKMap.ContainsKey(0) ? (int)Setting.Values.VKMap[0] : 'K'))
{
if (Common.DesMachineID == Common.MachineID || Common.DesMachineID == ID.ALL)
{
Setting.Values.UseVKMap = !Setting.Values.UseVKMap;
return Common.DesMachineID == ID.ALL;
}
}
}
return true;

View File

@@ -96,11 +96,6 @@ namespace MouseWithoutBorders.Class
InputProcessKeyEx(kd.wVk, kd.dwFlags, out bool eatKey);
if (Setting.Values.UseVKMap && Setting.Values.VKMap != null && Setting.Values.VKMap.ContainsKey(kd.wVk) && !ctrlDown)
{
kd.wVk = (int)Setting.Values.VKMap[kd.wVk];
}
if (!eatKey)
{
InputHook.RealData = false;
@@ -380,15 +375,6 @@ namespace MouseWithoutBorders.Class
}
}
}
else if (Setting.Values.VKMap != null && vkCode == (Setting.Values.VKMap.ContainsKey(0) ? (int)Setting.Values.VKMap[0] : 'K'))
{
if (ctrlDown && altDown && shiftDown)
{
ctrlDown = altDown = shiftDown = false;
Setting.Values.UseVKMap = !Setting.Values.UseVKMap;
eatKey = true;
}
}
else if (vkCode == Setting.Values.HotKeyCaptureScreen && ctrlDown && shiftDown && !altDown)
{
ctrlDown = shiftDown = false;

View File

@@ -350,7 +350,6 @@ namespace MouseWithoutBorders.Class
internal static void StartInputCallbackThread()
{
System.Collections.Hashtable dummy = Setting.Values.VKMap; // Reading from registry to memory.
Thread inputCallback = new(new ThreadStart(InputCallbackThread), "InputCallback Thread");
inputCallback.SetApartmentState(ApartmentState.STA);
inputCallback.Priority = ThreadPriority.Highest;

View File

@@ -858,25 +858,6 @@ namespace MouseWithoutBorders.Class
}
}
internal bool UseVKMap
{
get
{
lock (_loadingSettingsLock)
{
return _properties.UseVKMap;
}
}
set
{
lock (_loadingSettingsLock)
{
_properties.UseVKMap = value;
}
}
}
internal bool FirstCtrlShiftS
{
get
@@ -896,14 +877,6 @@ namespace MouseWithoutBorders.Class
}
}
internal Hashtable VKMap
{
get
{
return new Hashtable();
}
}
// Was a value read from registry on original Mouse Without Border, but default should be true. We wrongly released it as false, so we're forcing true here.
// This value wasn't changeable from UI, anyway.
internal bool StealFocusWhenSwitchingMachine => true;

View File

@@ -452,6 +452,7 @@ namespace MouseWithoutBorders
//
// checkBoxVKMap
//
this.checkBoxVKMap.Enabled = false;
this.checkBoxVKMap.AutoSize = true;
this.checkBoxVKMap.Location = new System.Drawing.Point(268, 98);
this.checkBoxVKMap.Name = "checkBoxVKMap";

View File

@@ -411,8 +411,8 @@ namespace MouseWithoutBorders
AddNewMachine();
}
checkBoxVKMap.Checked = Setting.Values.UseVKMap;
// NOTE(@yuyoyuppe): this option is deprecated
// checkBoxVKMap.Checked = Setting.Values.UseVKMap;
foreach (Machine m in machines)
{
if (m.StatusClient != SocketStatus.NA)
@@ -729,8 +729,9 @@ namespace MouseWithoutBorders
checkBoxDrawMouse.Checked = Setting.Values.DrawMouse;
checkBoxReverseLookup.Checked = Setting.Values.ReverseLookup;
checkBoxSameSubNet.Checked = Setting.Values.SameSubNetOnly;
checkBoxVKMap.Checked = Setting.Values.UseVKMap;
// NOTE(@yuyoyuppe): this option is deprecated
// checkBoxVKMap.Checked = Setting.Values.UseVKMap;
foreach (Machine m in machines)
{
m.MachineName = string.Empty;
@@ -1088,7 +1089,8 @@ namespace MouseWithoutBorders
private void CheckBoxVKMap_CheckedChanged(object sender, EventArgs e)
{
Setting.Values.UseVKMap = checkBoxVKMap.Checked;
// NOTE(@yuyoyuppe): this option is deprecated
// Setting.Values.UseVKMap = checkBoxVKMap.Checked;
ShowUpdateMessage();
}

View File

@@ -101,9 +101,6 @@ namespace Microsoft.PowerToys.Settings.UI.Library
public StringProperty Name2IP { get; set; }
[JsonConverter(typeof(BoolPropertyJsonConverter))]
public bool UseVKMap { get; set; }
[JsonConverter(typeof(BoolPropertyJsonConverter))]
public bool FirstCtrlShiftS { get; set; }
@@ -146,7 +143,6 @@ namespace Microsoft.PowerToys.Settings.UI.Library
TCPPort = new IntProperty(15100);
DrawMouseEx = true;
Name2IP = new StringProperty(string.Empty);
UseVKMap = false;
FirstCtrlShiftS = false;
}