mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-03 17:56:44 +02:00
[Shortcut Guide] Move into separate process (#11359)
This commit is contained in:
@@ -155,7 +155,33 @@ namespace PowerToysSettings
|
||||
return get_modifiers_repeat() | MOD_NOREPEAT;
|
||||
}
|
||||
|
||||
protected:
|
||||
std::wstring to_string()
|
||||
{
|
||||
std::wstring result = L"";
|
||||
if (shift_pressed())
|
||||
{
|
||||
result += L"shift+";
|
||||
}
|
||||
|
||||
if (ctrl_pressed())
|
||||
{
|
||||
result += L"ctrl+";
|
||||
}
|
||||
|
||||
if (win_pressed())
|
||||
{
|
||||
result += L"win+";
|
||||
}
|
||||
|
||||
if (alt_pressed())
|
||||
{
|
||||
result += L"alt+";
|
||||
}
|
||||
|
||||
result += key_from_code(get_code());
|
||||
return result;
|
||||
}
|
||||
|
||||
static std::wstring key_from_code(UINT key_code)
|
||||
{
|
||||
auto layout = GetKeyboardLayout(0);
|
||||
@@ -209,6 +235,8 @@ namespace PowerToysSettings
|
||||
}
|
||||
return L"(Key " + std::to_wstring(key_code) + L")";
|
||||
}
|
||||
|
||||
protected:
|
||||
HotkeyObject(json::JsonObject hotkey_json) :
|
||||
m_json(std::move(hotkey_json))
|
||||
{
|
||||
|
||||
@@ -150,10 +150,6 @@ public
|
||||
|
||||
static String ^ ShowColorPickerSharedEvent() {
|
||||
return gcnew String(CommonSharedConstants::SHOW_COLOR_PICKER_SHARED_EVENT);
|
||||
}
|
||||
|
||||
static String ^ ShowShortcutGuideSharedEvent() {
|
||||
return gcnew String(CommonSharedConstants::SHOW_SHORTCUT_GUIDE_SHARED_EVENT);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
@@ -22,8 +22,7 @@ namespace CommonSharedConstants
|
||||
// Path to the event used to show Color Picker
|
||||
const wchar_t SHOW_COLOR_PICKER_SHARED_EVENT[] = L"Local\\ShowColorPickerEvent-8c46be2a-3e05-4186-b56b-4ae986ef2525";
|
||||
|
||||
// Path to the event used to show Shortcut Guide
|
||||
const wchar_t SHOW_SHORTCUT_GUIDE_SHARED_EVENT[] = L"Local\\ShowShortcutGuideEvent-6982d682-7462-404f-95af-86ae3f089c4f";
|
||||
const wchar_t SHORTCUT_GUIDE_EXIT_EVENT[] = L"Local\\ShortcutGuide-ExitEvent-35697cdd-a3d2-47d6-a246-34efcc73eac0";
|
||||
|
||||
// Max DWORD for key code to disable keys.
|
||||
const int VK_DISABLED = 0x100;
|
||||
|
||||
Reference in New Issue
Block a user