[KBM] decoupling editor and engine (#11133)

This commit is contained in:
Mykhailo Pylyp
2021-05-07 11:16:31 +03:00
committed by GitHub
parent 9461909321
commit 8785fca309
77 changed files with 2509 additions and 2775 deletions

View File

@@ -0,0 +1,25 @@
#pragma once
#include <keyboardmanager/common/Shortcut.h>
#include "ShortcutErrorType.h"
namespace EditorHelpers
{
// Function to check if two keys are equal or cover the same set of keys. Return value depends on type of overlap
ShortcutErrorType DoKeysOverlap(DWORD first, DWORD second);
// Function to check if a modifier has been repeated in the previous drop downs
bool CheckRepeatedModifier(const std::vector<int32_t>& currentKeys, int selectedKeyCodes);
// Function to return true if the shortcut is valid. A valid shortcut has atleast one modifier, as well as an action key
bool IsValidShortcut(Shortcut shortcut);
// Function to check if the two shortcuts are equal or cover the same set of keys. Return value depends on type of overlap
ShortcutErrorType DoShortcutsOverlap(const Shortcut& first, const Shortcut& second);
// Function to return a vector of hstring for each key in the display order
std::vector<winrt::hstring> GetKeyVector(Shortcut shortcut, LayoutMap& keyboardMap);
// Function to check if the shortcut is illegal (i.e. Win+L or Ctrl+Alt+Del)
ShortcutErrorType IsShortcutIllegal(Shortcut shortcut);
}