Keyboard disable (#6874)

Added disable key/shortcut functionality
This commit is contained in:
Mykhailo Pylyp
2020-10-02 15:36:36 +03:00
committed by GitHub
parent b2e72e1ca4
commit 3f25d7ccc8
15 changed files with 298 additions and 34 deletions

View File

@@ -1,6 +1,7 @@
#include "pch.h"
#include "BufferValidationHelpers.h"
#include <keyboardmanager/common/KeyboardManagerConstants.h>
#include <common\shared_constants.h>
namespace BufferValidationHelpers
{
@@ -121,9 +122,14 @@ namespace BufferValidationHelpers
errorType = KeyboardManagerHelper::ErrorType::ShortcutOneActionKey;
}
}
// Disable can not be selected if one modifier key has already been selected
else if (keyCodeList[selectedKeyIndex] == CommonSharedConstants::VK_DISABLED && dropDownIndex)
{
errorType = KeyboardManagerHelper::ErrorType::ShortcutDisableAsActionKey;
}
// If none of the above, then the action key will be set
}
// If it is the not the last drop down
// If it is not the last drop down
else
{
if (KeyboardManagerHelper::IsModifierKey(keyCodeList[selectedKeyIndex]))
@@ -158,6 +164,11 @@ namespace BufferValidationHelpers
errorType = KeyboardManagerHelper::ErrorType::ShortcutAtleast2Keys;
}
}
// Allow selection of VK_DISABLE only in first dropdown
else if (keyCodeList[selectedKeyIndex] == CommonSharedConstants::VK_DISABLED && dropDownIndex)
{
errorType = KeyboardManagerHelper::ErrorType::ShortcutDisableAsActionKey;
}
// If the user tries to set an action key check if all drop down menus after this are empty if it is not the first key. If it is a hybrid control, this can be done even on the first key
else if (dropDownIndex != 0 || isHybridControl)
{