mirror of
https://github.com/microsoft/PowerToys.git
synced 2025-06-11 12:14:53 +08:00
Remove unused code
This commit is contained in:
parent
0f231c3040
commit
0bd94cd997
@ -685,20 +685,6 @@ bool GetShortcutRemapByType(void* config, int operationType, int index, Shortcut
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Test function to call the remapping helper function
|
|
||||||
bool CheckIfRemappingsAreValid()
|
|
||||||
{
|
|
||||||
RemapBuffer remapBuffer;
|
|
||||||
|
|
||||||
// Mock valid key to key remappings
|
|
||||||
remapBuffer.push_back(RemapBufferRow{ RemapBufferItem({ (DWORD)0x41, (DWORD)0x42 }), std::wstring() });
|
|
||||||
remapBuffer.push_back(RemapBufferRow{ RemapBufferItem({ (DWORD)0x42, (DWORD)0x43 }), std::wstring() });
|
|
||||||
|
|
||||||
auto result = LoadingAndSavingRemappingHelper::CheckIfRemappingsAreValid(remapBuffer);
|
|
||||||
|
|
||||||
return result == ShortcutErrorType::NoError;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Get the list of keyboard keys in Editor
|
// Get the list of keyboard keys in Editor
|
||||||
int GetKeyboardKeysList(bool isShortcut, KeyNamePair* keyList, int maxCount)
|
int GetKeyboardKeysList(bool isShortcut, KeyNamePair* keyList, int maxCount)
|
||||||
{
|
{
|
||||||
|
@ -77,5 +77,4 @@ extern "C"
|
|||||||
__declspec(dllexport) bool DeleteSingleKeyToTextRemap(void* config, int originalKey);
|
__declspec(dllexport) bool DeleteSingleKeyToTextRemap(void* config, int originalKey);
|
||||||
__declspec(dllexport) bool DeleteShortcutRemap(void* config, const wchar_t* originalKeys, const wchar_t* targetApp);
|
__declspec(dllexport) bool DeleteShortcutRemap(void* config, const wchar_t* originalKeys, const wchar_t* targetApp);
|
||||||
}
|
}
|
||||||
extern "C" __declspec(dllexport) bool CheckIfRemappingsAreValid();
|
|
||||||
extern "C" __declspec(dllexport) int GetKeyboardKeysList(bool isShortcut, KeyNamePair* keyList, int maxCount);
|
extern "C" __declspec(dllexport) int GetKeyboardKeysList(bool isShortcut, KeyNamePair* keyList, int maxCount);
|
||||||
|
@ -45,9 +45,6 @@ namespace KeyboardManagerEditorUI.Pages
|
|||||||
[DllImport("PowerToys.KeyboardManagerEditorLibraryWrapper.dll", CallingConvention = CallingConvention.Cdecl)]
|
[DllImport("PowerToys.KeyboardManagerEditorLibraryWrapper.dll", CallingConvention = CallingConvention.Cdecl)]
|
||||||
private static extern int GetKeyboardKeysList(bool isShortcut, [Out] KeyNamePair[] keyList, int maxCount);
|
private static extern int GetKeyboardKeysList(bool isShortcut, [Out] KeyNamePair[] keyList, int maxCount);
|
||||||
|
|
||||||
[DllImport("PowerToys.KeyboardManagerEditorLibraryWrapper.dll", CallingConvention = CallingConvention.Cdecl)]
|
|
||||||
private static extern bool CheckIfRemappingsAreValid();
|
|
||||||
|
|
||||||
public List<KeyboardKey> KeysList { get; private set; } = new List<KeyboardKey>();
|
public List<KeyboardKey> KeysList { get; private set; } = new List<KeyboardKey>();
|
||||||
|
|
||||||
public ExistingUI()
|
public ExistingUI()
|
||||||
@ -81,14 +78,6 @@ namespace KeyboardManagerEditorUI.Pages
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void KeyComboBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
|
|
||||||
{
|
|
||||||
if (e.AddedItems.Count > 0 && e.AddedItems[0] is KeyboardKey key)
|
|
||||||
{
|
|
||||||
Console.WriteLine($"selected key: {key.KeyName} (code: {key.KeyCode})");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void Button_Click(object sender, RoutedEventArgs e)
|
private void Button_Click(object sender, RoutedEventArgs e)
|
||||||
{
|
{
|
||||||
var button = sender as Button;
|
var button = sender as Button;
|
||||||
|
Loading…
Reference in New Issue
Block a user