2020-04-20 23:22:36 +08:00
|
|
|
#pragma once
|
|
|
|
#include <string>
|
2020-06-12 04:07:46 +08:00
|
|
|
#include <winrt/base.h>
|
2020-12-15 20:16:09 +08:00
|
|
|
#include <common/utils/resources.h>
|
2020-08-25 06:10:50 +08:00
|
|
|
#include "keyboardmanager/dll/Generated Files/resource.h"
|
2021-04-09 01:42:46 +08:00
|
|
|
#include "common/interop/shared_constants.h"
|
2020-04-20 23:22:36 +08:00
|
|
|
|
|
|
|
namespace KeyboardManagerConstants
|
|
|
|
{
|
|
|
|
// Name of the powertoy module.
|
|
|
|
inline const std::wstring ModuleName = L"Keyboard Manager";
|
|
|
|
|
|
|
|
// Name of the property use to store current active configuration.
|
|
|
|
inline const std::wstring ActiveConfigurationSettingName = L"activeConfiguration";
|
|
|
|
|
|
|
|
// Name of the property use to store single keyremaps.
|
|
|
|
inline const std::wstring RemapKeysSettingName = L"remapKeys";
|
|
|
|
|
|
|
|
// Name of the property use to store single keyremaps array in case of in process approach.
|
|
|
|
inline const std::wstring InProcessRemapKeysSettingName = L"inProcess";
|
|
|
|
|
|
|
|
// Name of the property use to store shortcut remaps.
|
|
|
|
inline const std::wstring RemapShortcutsSettingName = L"remapShortcuts";
|
|
|
|
|
|
|
|
// Name of the property use to store global shortcut remaps array.
|
|
|
|
inline const std::wstring GlobalRemapShortcutsSettingName = L"global";
|
|
|
|
|
2020-07-11 08:07:28 +08:00
|
|
|
// Name of the property use to store app specific shortcut remaps array.
|
|
|
|
inline const std::wstring AppSpecificRemapShortcutsSettingName = L"appSpecific";
|
|
|
|
|
2020-04-20 23:22:36 +08:00
|
|
|
// Name of the property use to store original keys.
|
|
|
|
inline const std::wstring OriginalKeysSettingName = L"originalKeys";
|
|
|
|
|
|
|
|
// Name of the property use to store new remap keys.
|
|
|
|
inline const std::wstring NewRemapKeysSettingName = L"newRemapKeys";
|
|
|
|
|
2020-07-11 08:07:28 +08:00
|
|
|
// Name of the property use to store the target application.
|
|
|
|
inline const std::wstring TargetAppSettingName = L"targetApp";
|
|
|
|
|
2020-04-20 23:22:36 +08:00
|
|
|
// Name of the default configuration.
|
|
|
|
inline const std::wstring DefaultConfiguration = L"default";
|
|
|
|
|
|
|
|
// Name of the named mutex used for configuration file.
|
2021-04-09 01:42:46 +08:00
|
|
|
inline const std::wstring ConfigFileMutexName = CommonSharedConstants::KEYBOARD_MANAGER_CONFIG_FILE_MUTEX_NAME;
|
2020-04-20 23:22:36 +08:00
|
|
|
|
|
|
|
// Name of the dummy update file.
|
|
|
|
inline const std::wstring DummyUpdateFileName = L"settings-updated.json";
|
2020-04-27 06:09:40 +08:00
|
|
|
|
2020-05-09 08:34:24 +08:00
|
|
|
// Minimum and maximum size of a shortcut
|
|
|
|
inline const long MinShortcutSize = 2;
|
|
|
|
inline const long MaxShortcutSize = 3;
|
|
|
|
|
|
|
|
// Default window sizes
|
2020-05-13 01:17:27 +08:00
|
|
|
inline const int DefaultEditKeyboardWindowWidth = 800;
|
|
|
|
inline const int DefaultEditKeyboardWindowHeight = 600;
|
2020-09-23 08:46:57 +08:00
|
|
|
inline const int MinimumEditKeyboardWindowWidth = 500;
|
|
|
|
inline const int MinimumEditKeyboardWindowHeight = 450;
|
|
|
|
inline const int EditKeyboardTableMinWidth = 700;
|
2020-07-09 07:24:30 +08:00
|
|
|
inline const int DefaultEditShortcutsWindowWidth = 1050;
|
2020-05-13 01:17:27 +08:00
|
|
|
inline const int DefaultEditShortcutsWindowHeight = 600;
|
2020-09-23 08:46:57 +08:00
|
|
|
inline const int MinimumEditShortcutsWindowWidth = 500;
|
|
|
|
inline const int MinimumEditShortcutsWindowHeight = 500;
|
|
|
|
inline const int EditShortcutsTableMinWidth = 1000;
|
2020-05-09 08:34:24 +08:00
|
|
|
|
|
|
|
// Key Remap table constants
|
2020-05-12 01:10:36 +08:00
|
|
|
inline const long RemapTableColCount = 4;
|
2020-05-09 08:34:24 +08:00
|
|
|
inline const long RemapTableHeaderCount = 2;
|
|
|
|
inline const long RemapTableOriginalColIndex = 0;
|
|
|
|
inline const long RemapTableArrowColIndex = 1;
|
|
|
|
inline const long RemapTableNewColIndex = 2;
|
|
|
|
inline const long RemapTableRemoveColIndex = 3;
|
2020-06-25 05:55:02 +08:00
|
|
|
inline const DWORD64 RemapTableDropDownWidth = 110;
|
2020-05-09 08:34:24 +08:00
|
|
|
|
|
|
|
// Shortcut table constants
|
2020-07-09 07:24:30 +08:00
|
|
|
inline const long ShortcutTableColCount = 5;
|
|
|
|
inline const long ShortcutTableHeaderCount = 3;
|
2020-05-09 08:34:24 +08:00
|
|
|
inline const long ShortcutTableOriginalColIndex = 0;
|
|
|
|
inline const long ShortcutTableArrowColIndex = 1;
|
|
|
|
inline const long ShortcutTableNewColIndex = 2;
|
2020-07-09 07:24:30 +08:00
|
|
|
inline const long ShortcutTableTargetAppColIndex = 3;
|
|
|
|
inline const long ShortcutTableRemoveColIndex = 4;
|
2020-11-06 22:24:11 +08:00
|
|
|
inline const long ShortcutArrowColumnWidth = 90;
|
2020-06-25 05:55:02 +08:00
|
|
|
inline const DWORD64 ShortcutTableDropDownWidth = 110;
|
|
|
|
inline const DWORD64 ShortcutTableDropDownSpacing = 10;
|
2020-11-06 22:24:11 +08:00
|
|
|
inline const long ShortcutOriginColumnWidth = 3 * ShortcutTableDropDownWidth + 2 * ShortcutTableDropDownSpacing;
|
|
|
|
inline const long ShortcutTargetColumnWidth = 3 * ShortcutTableDropDownWidth + 2 * ShortcutTableDropDownSpacing + 25;
|
2020-05-09 08:34:24 +08:00
|
|
|
|
|
|
|
// Drop down height used for both Edit Keyboard and Edit Shortcuts
|
2020-06-25 05:55:02 +08:00
|
|
|
inline const DWORD64 TableDropDownHeight = 200;
|
2020-11-06 22:24:11 +08:00
|
|
|
inline const DWORD64 TableArrowColWidth = 230;
|
2020-06-25 05:55:02 +08:00
|
|
|
inline const DWORD64 TableRemoveColWidth = 20;
|
|
|
|
inline const DWORD64 TableWarningColWidth = 20;
|
2020-11-06 22:24:11 +08:00
|
|
|
inline const DWORD64 TableTargetAppColWidth = ShortcutTableDropDownWidth + TableRemoveColWidth * 2;
|
2020-05-12 03:45:55 +08:00
|
|
|
|
|
|
|
// Shared style constants for both Remap Table and Shortcut Table
|
2020-06-25 05:55:02 +08:00
|
|
|
inline const DWORD64 HeaderButtonWidth = 100;
|
2020-05-29 05:47:32 +08:00
|
|
|
|
|
|
|
// Flags used for distinguishing key events sent by Keyboard Manager
|
2020-06-06 03:54:52 +08:00
|
|
|
inline const ULONG_PTR KEYBOARDMANAGER_SINGLEKEY_FLAG = 0x11; // Single key remaps
|
|
|
|
inline const ULONG_PTR KEYBOARDMANAGER_SHORTCUT_FLAG = 0x101; // Shortcut remaps
|
|
|
|
inline const ULONG_PTR KEYBOARDMANAGER_SUPPRESS_FLAG = 0x111; // Key events which must be suppressed
|
2020-05-29 05:47:32 +08:00
|
|
|
|
|
|
|
// Dummy key event used in between key up and down events to prevent certain global events from happening
|
|
|
|
inline const DWORD DUMMY_KEY = 0xFF;
|
2020-07-09 07:24:30 +08:00
|
|
|
|
2020-10-09 02:28:37 +08:00
|
|
|
// Number of key messages required while sending a dummy key event
|
|
|
|
inline const size_t DUMMY_KEY_EVENT_SIZE = 2;
|
|
|
|
|
2020-07-09 07:24:30 +08:00
|
|
|
// String constant for the default app name in Remap shortcuts
|
2020-08-18 04:46:50 +08:00
|
|
|
inline const std::wstring DefaultAppName = GET_RESOURCE_STRING(IDS_EDITSHORTCUTS_ALLAPPS);
|
2020-07-24 07:43:49 +08:00
|
|
|
|
2020-07-11 08:53:41 +08:00
|
|
|
// String constant to represent no activated application in app-specific shortcuts
|
|
|
|
inline const std::wstring NoActivatedApp = L"";
|
2020-04-20 23:22:36 +08:00
|
|
|
}
|