[Shortcut Guide] Move into separate process (#11359)

This commit is contained in:
Mykhailo Pylyp
2021-05-20 15:07:34 +03:00
committed by GitHub
parent c948c1fca8
commit 601da71f15
114 changed files with 2346 additions and 1771 deletions

View File

@@ -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))
{

View File

@@ -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);
}
};
}

View File

@@ -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;