Add support for shortcuts with >2 keys (dev/keyboardManager) (#1697)

* Added check keyboard state function

* Added keyboard state check to avoid n-key shortcuts being affected by 2 key shortcuts

* Added support for n key shortcuts in backend and UI

* Added a fix to ensure mouse buttons states are not checked

* reverted some debugging changes

* reverted some debugging changes
This commit is contained in:
Arjun Balgovind
2020-03-26 11:22:25 -07:00
committed by Udit Singh
parent b713083574
commit 90ddcb30bf
2 changed files with 320 additions and 80 deletions

View File

@@ -140,8 +140,8 @@ void createEditShortcutsWindow(HINSTANCE hInst, KeyboardManagerState& keyboardMa
std::vector<DWORD> originalKeys = convertWStringVectorToIntegerVector<DWORD>(splitwstring(originalShortcut.c_str(), L' '));
std::vector<WORD> newKeys = convertWStringVectorToIntegerVector<WORD>(splitwstring(newShortcut.c_str(), L' '));
// Check if number of keys is two since only that is currently implemented
if (originalKeys.size() == 2 && newKeys.size() == 2)
// Shortcut should consist of atleast two keys
if (originalKeys.size() > 1 && newKeys.size() > 1)
{
keyboardManagerState.AddOSLevelShortcut(originalKeys, newKeys);
}