mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-09 04:37:30 +02:00
Add support for Common Win key in KBM (#2308)
* Added common win key to layoutmap * Added common win key support for edit shortcuts * Adjusted key names
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
#pragma once
|
||||
#include "Helpers.h"
|
||||
#include "KeyboardManagerConstants.h"
|
||||
#include "..\common\keyboard_layout.h"
|
||||
#include "../common/keyboard_layout.h"
|
||||
#include "../common/shared_constants.h"
|
||||
#include <interface/lowlevel_keyboard_event_data.h>
|
||||
|
||||
// Enum type to store different states of the win key
|
||||
@@ -37,14 +37,7 @@ public:
|
||||
for (auto it : keys)
|
||||
{
|
||||
auto vkKeyCode = std::stoul(it);
|
||||
if (vkKeyCode == KeyboardManagerConstants::VK_WIN_BOTH)
|
||||
{
|
||||
SetKey(vkKeyCode, true);
|
||||
}
|
||||
else
|
||||
{
|
||||
SetKey(vkKeyCode);
|
||||
}
|
||||
SetKey(vkKeyCode);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -149,15 +142,15 @@ public:
|
||||
// Function to check if the input key matches the shift key expected in the shortcut
|
||||
bool CheckShiftKey(const DWORD& input) const;
|
||||
|
||||
// Function to set a key in the shortcut based on the passed key code argument. Since there is no VK_WIN code, use the second argument for setting common win key. If isWinBoth is true then first arg is ignored. Returns false if it is already set to the same value. This can be used to avoid UI refreshing
|
||||
bool SetKey(const DWORD& input, const bool& isWinBoth = false);
|
||||
// Function to set a key in the shortcut based on the passed key code argument. Returns false if it is already set to the same value. This can be used to avoid UI refreshing
|
||||
bool SetKey(const DWORD& input);
|
||||
|
||||
// Function to reset the state of a shortcut key based on the passed key code argument. Since there is no VK_WIN code, use the second argument for setting common win key.
|
||||
void ResetKey(const DWORD& input, const bool& isWinBoth = false);
|
||||
// Function to reset the state of a shortcut key based on the passed key code argument
|
||||
void ResetKey(const DWORD& input);
|
||||
|
||||
// Function to return the string representation of the shortcut in virtual key codes appended in a string by ";" separator.
|
||||
winrt::hstring ToHstringVK() const;
|
||||
|
||||
|
||||
// Function to return a vector of hstring for each key in the display order
|
||||
std::vector<winrt::hstring> GetKeyVector(LayoutMap& keyboardMap) const;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user