PowerToys/src/modules/keyboardmanager/common/KeyboardManagerConstants.h

108 lines
5.1 KiB
C
Raw Normal View History

#pragma once
namespace KeyboardManagerConstants
{
[KBM] Migrate Engine and Editor into separate processes (#10774) * Move KBM engine into separate process (#10672) * [KBM] Migrate KBM UI out of the runner (#10709) * Clean up keyboard hook handles (#10817) * [C++ common] Unhandled exception handler (#10821) * [KBM] Use icon in the KeyboardManagerEditor (#10845) * [KBM] Move resources from the Common project to the Editor. (#10844) * KBM Editor tests (#10858) * Rename engine executable (#10868) * clean up (#10870) * [KBM] Changed Editor and libraries output folders (#10871) * [KBM] New logs structure (#10872) * Add unhandled exception handling to the editor (#10874) * [KBM] Trace for edit keyboard window * Logging for XamlBridge message loop * [KBM] Added Editor and Engine to the installer (#10876) * Fix spelling * Interprocess communication logs, remove unnecessary windows message logs * [KBM] Separated telemetry for the engine and editor. (#10889) * [KBM] Editor test project (#10891) * Versions for the engine and the editor (#10897) * Add the editor's and the engine's executables to signing process (#10900) * [KBM editor] Run only one instance, exit when parent process exits (#10890) * [KBM] Force kill editor process to avoid XAML crash (#10907) * [KBM] Force kill editor process to avoid XAML crash * Fix event releasing Co-authored-by: mykhailopylyp <17161067+mykhailopylyp@users.noreply.github.com> * Make the editor dpi aware (#10908) * [KBM] KeyboardManagerCommon refactoring (#10909) * Do not start the process if it is already started (#10910) * logs * Update src/modules/keyboardmanager/KeyboardManagerEditorLibrary/EditKeyboardWindow.cpp * Update src/modules/keyboardmanager/KeyboardManagerEditorLibrary/EditKeyboardWindow.cpp * [KBM] Rename InitUnhandledExceptionHandler to make it explicit that is for x64 only. We will fix it properly when adding support for ARM64 and add a header with the proper conditional building. * [KBM] rename file/class/variables using camel case * [KBM] Rename "event_locker" -> "EventLocker" * [KBM] rename process_waiter Add a TODO comment * [KBM] rename methods Add TODO comment * [KBM] use uppercase for function names * [KBM] use uppercase for methos, lowercase for properties * [KBM] rename method, make methods private, formatting * [KBM] rename private variables * [KBM] use uppercase for function names * [KBM] Added support to run the editor stand-alone when built in debug mode * Update src/modules/keyboardmanager/KeyboardManagerEditor/KeyboardManagerEditor.cpp * Check success of event creation, comment (#10947) * [KBM] code formatting (#10951) * [KBM] code formatting * Update src/modules/keyboardmanager/KeyboardManagerEditorLibrary/BufferValidationHelpers.cpp * [KBM] tracing * [KBM] Remappings not showing fix. (#10954) * removed mutex * retry loop for reading * retry on reading config once * log error Co-authored-by: Enrico Giordani <enricogior@users.noreply.github.com> Co-authored-by: Enrico Giordani <enricogior@users.noreply.github.com> Co-authored-by: Seraphima Zykova <zykovas91@gmail.com> Co-authored-by: Enrico Giordani <enricogior@users.noreply.github.com> Co-authored-by: Enrico Giordani <enrico.giordani@gmail.com>
2021-04-27 03:01:38 +08:00
// Event name for signaling settings changes
inline const std::wstring SettingsEventName = L"PowerToys_KeyboardManager_Event_Settings";
inline const std::wstring EditorWindowEventName = L"PowerToys_KeyboardManager_Event_EditorWindow";
// 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";
// Name of the property use to store app specific shortcut remaps array.
inline const std::wstring AppSpecificRemapShortcutsSettingName = L"appSpecific";
// 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";
// Name of the property use to store the target application.
inline const std::wstring TargetAppSettingName = L"targetApp";
// Name of the default configuration.
inline const std::wstring DefaultConfiguration = L"default";
// Name of the dummy update file.
inline const std::wstring DummyUpdateFileName = L"settings-updated.json";
// Minimum and maximum size of a shortcut
inline const long MinShortcutSize = 2;
inline const long MaxShortcutSize = 3;
// Default window sizes
inline const int DefaultEditKeyboardWindowWidth = 800;
inline const int DefaultEditKeyboardWindowHeight = 600;
inline const int MinimumEditKeyboardWindowWidth = 500;
inline const int MinimumEditKeyboardWindowHeight = 450;
inline const int EditKeyboardTableMinWidth = 700;
inline const int DefaultEditShortcutsWindowWidth = 1050;
inline const int DefaultEditShortcutsWindowHeight = 600;
inline const int MinimumEditShortcutsWindowWidth = 500;
inline const int MinimumEditShortcutsWindowHeight = 500;
inline const int EditShortcutsTableMinWidth = 1000;
// Key Remap table constants
inline const long RemapTableColCount = 4;
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;
inline const DWORD64 RemapTableDropDownWidth = 110;
// Shortcut table constants
inline const long ShortcutTableColCount = 5;
inline const long ShortcutTableHeaderCount = 3;
inline const long ShortcutTableOriginalColIndex = 0;
inline const long ShortcutTableArrowColIndex = 1;
inline const long ShortcutTableNewColIndex = 2;
inline const long ShortcutTableTargetAppColIndex = 3;
inline const long ShortcutTableRemoveColIndex = 4;
inline const long ShortcutArrowColumnWidth = 90;
inline const DWORD64 ShortcutTableDropDownWidth = 110;
inline const DWORD64 ShortcutTableDropDownSpacing = 10;
inline const long ShortcutOriginColumnWidth = 3 * ShortcutTableDropDownWidth + 2 * ShortcutTableDropDownSpacing;
inline const long ShortcutTargetColumnWidth = 3 * ShortcutTableDropDownWidth + 2 * ShortcutTableDropDownSpacing + 25;
// Drop down height used for both Edit Keyboard and Edit Shortcuts
inline const DWORD64 TableDropDownHeight = 200;
inline const DWORD64 TableArrowColWidth = 230;
inline const DWORD64 TableRemoveColWidth = 20;
inline const DWORD64 TableWarningColWidth = 20;
inline const DWORD64 TableTargetAppColWidth = ShortcutTableDropDownWidth + TableRemoveColWidth * 2;
// Shared style constants for both Remap Table and Shortcut Table
inline const DWORD64 HeaderButtonWidth = 100;
// Flags used for distinguishing key events sent by Keyboard Manager
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
// Dummy key event used in between key up and down events to prevent certain global events from happening
inline const DWORD DUMMY_KEY = 0xFF;
// Number of key messages required while sending a dummy key event
inline const size_t DUMMY_KEY_EVENT_SIZE = 2;
// String constant to represent no activated application in app-specific shortcuts
inline const std::wstring NoActivatedApp = L"";
}