2020-08-14 07:32:15 +08:00
|
|
|
#include "pch.h"
|
|
|
|
#include "BufferValidationHelpers.h"
|
2021-04-27 03:01:38 +08:00
|
|
|
|
2020-12-15 20:16:09 +08:00
|
|
|
#include <common/interop/shared_constants.h>
|
2021-05-07 16:16:31 +08:00
|
|
|
#include <keyboardmanager/common/KeyboardManagerConstants.h>
|
2021-09-03 23:19:16 +08:00
|
|
|
#include <keyboardmanager/common/Helpers.h>
|
2021-04-27 03:01:38 +08:00
|
|
|
|
2021-05-07 16:16:31 +08:00
|
|
|
#include "KeyboardManagerEditorStrings.h"
|
|
|
|
#include "KeyDropDownControl.h"
|
|
|
|
#include "UIHelpers.h"
|
|
|
|
#include "EditorHelpers.h"
|
|
|
|
#include "EditorConstants.h"
|
2020-08-14 07:32:15 +08:00
|
|
|
|
|
|
|
namespace BufferValidationHelpers
|
|
|
|
{
|
2021-09-03 23:19:16 +08:00
|
|
|
// Helper function to verify if a key is being remapped to/from its combined key
|
|
|
|
bool IsKeyRemappingToItsCombinedKey(DWORD keyCode1, DWORD keyCode2)
|
|
|
|
{
|
|
|
|
return (keyCode1 == Helpers::GetCombinedKey(keyCode1) || keyCode2 == Helpers::GetCombinedKey(keyCode2)) &&
|
|
|
|
Helpers::GetCombinedKey(keyCode1) == Helpers::GetCombinedKey(keyCode2);
|
|
|
|
}
|
|
|
|
|
2020-08-14 07:32:15 +08:00
|
|
|
// Function to validate and update an element of the key remap buffer when the selection has changed
|
2021-05-07 16:16:31 +08:00
|
|
|
ShortcutErrorType ValidateAndUpdateKeyBufferElement(int rowIndex, int colIndex, int selectedKeyCode, RemapBuffer& remapBuffer)
|
2020-08-14 07:32:15 +08:00
|
|
|
{
|
2021-05-07 16:16:31 +08:00
|
|
|
ShortcutErrorType errorType = ShortcutErrorType::NoError;
|
2020-08-14 07:32:15 +08:00
|
|
|
|
|
|
|
// Check if the element was not found or the index exceeds the known keys
|
2020-10-19 17:27:47 +08:00
|
|
|
if (selectedKeyCode != -1)
|
2020-08-14 07:32:15 +08:00
|
|
|
{
|
|
|
|
// Check if the value being set is the same as the other column
|
2023-02-08 19:01:13 +08:00
|
|
|
if (remapBuffer[rowIndex].first[std::abs(colIndex - 1)].index() == 0)
|
2020-08-14 07:32:15 +08:00
|
|
|
{
|
2023-02-08 19:01:13 +08:00
|
|
|
DWORD otherColumnKeyCode = std::get<DWORD>(remapBuffer[rowIndex].first[std::abs(colIndex - 1)]);
|
2021-09-03 23:19:16 +08:00
|
|
|
if (otherColumnKeyCode == selectedKeyCode || IsKeyRemappingToItsCombinedKey(selectedKeyCode, otherColumnKeyCode))
|
2020-08-14 07:32:15 +08:00
|
|
|
{
|
2021-05-07 16:16:31 +08:00
|
|
|
errorType = ShortcutErrorType::MapToSameKey;
|
2020-08-14 07:32:15 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// If one column is shortcut and other is key no warning required
|
|
|
|
|
2021-05-07 16:16:31 +08:00
|
|
|
if (errorType == ShortcutErrorType::NoError && colIndex == 0)
|
2020-08-14 07:32:15 +08:00
|
|
|
{
|
|
|
|
// Check if the key is already remapped to something else
|
|
|
|
for (int i = 0; i < remapBuffer.size(); i++)
|
|
|
|
{
|
|
|
|
if (i != rowIndex)
|
|
|
|
{
|
|
|
|
if (remapBuffer[i].first[colIndex].index() == 0)
|
|
|
|
{
|
2021-05-07 16:16:31 +08:00
|
|
|
ShortcutErrorType result = EditorHelpers::DoKeysOverlap(std::get<DWORD>(remapBuffer[i].first[colIndex]), selectedKeyCode);
|
|
|
|
if (result != ShortcutErrorType::NoError)
|
2020-08-14 07:32:15 +08:00
|
|
|
{
|
|
|
|
errorType = result;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// If one column is shortcut and other is key no warning required
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// If there is no error, set the buffer
|
2021-05-07 16:16:31 +08:00
|
|
|
if (errorType == ShortcutErrorType::NoError)
|
2020-08-14 07:32:15 +08:00
|
|
|
{
|
2021-06-02 00:15:16 +08:00
|
|
|
remapBuffer[rowIndex].first[colIndex] = (DWORD)selectedKeyCode;
|
2020-08-14 07:32:15 +08:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2021-06-02 00:15:16 +08:00
|
|
|
remapBuffer[rowIndex].first[colIndex] = (DWORD)0;
|
2020-08-14 07:32:15 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
// Reset to null if the key is not found
|
2021-06-02 00:15:16 +08:00
|
|
|
remapBuffer[rowIndex].first[colIndex] = (DWORD)0;
|
2020-08-14 07:32:15 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
return errorType;
|
|
|
|
}
|
|
|
|
|
|
|
|
// Function to validate an element of the shortcut remap buffer when the selection has changed
|
2021-05-07 16:16:31 +08:00
|
|
|
std::pair<ShortcutErrorType, DropDownAction> ValidateShortcutBufferElement(int rowIndex, int colIndex, uint32_t dropDownIndex, const std::vector<int32_t>& selectedCodes, std::wstring appName, bool isHybridControl, const RemapBuffer& remapBuffer, bool dropDownFound)
|
2020-08-14 07:32:15 +08:00
|
|
|
{
|
|
|
|
BufferValidationHelpers::DropDownAction dropDownAction = BufferValidationHelpers::DropDownAction::NoAction;
|
2021-05-07 16:16:31 +08:00
|
|
|
ShortcutErrorType errorType = ShortcutErrorType::NoError;
|
2020-10-19 17:27:47 +08:00
|
|
|
size_t dropDownCount = selectedCodes.size();
|
|
|
|
DWORD selectedKeyCode = dropDownFound ? selectedCodes[dropDownIndex] : -1;
|
2020-08-14 07:32:15 +08:00
|
|
|
|
2020-10-19 17:27:47 +08:00
|
|
|
if (selectedKeyCode != -1 && dropDownFound)
|
2020-08-14 07:32:15 +08:00
|
|
|
{
|
|
|
|
// If only 1 drop down and action key is chosen: Warn that a modifier must be chosen (if the drop down is not for a hybrid scenario)
|
2021-05-07 16:16:31 +08:00
|
|
|
if (dropDownCount == 1 && !Helpers::IsModifierKey(selectedKeyCode) && !isHybridControl)
|
2020-08-14 07:32:15 +08:00
|
|
|
{
|
|
|
|
// warn and reset the drop down
|
2021-05-07 16:16:31 +08:00
|
|
|
errorType = ShortcutErrorType::ShortcutStartWithModifier;
|
2020-08-14 07:32:15 +08:00
|
|
|
}
|
|
|
|
else if (dropDownIndex == dropDownCount - 1)
|
|
|
|
{
|
2021-04-27 03:01:38 +08:00
|
|
|
// If it is the last drop down
|
2020-08-14 07:32:15 +08:00
|
|
|
// If last drop down and a modifier is selected: add a new drop down (max drop down count should be enforced)
|
2021-05-07 16:16:31 +08:00
|
|
|
if (Helpers::IsModifierKey(selectedKeyCode) && dropDownCount < EditorConstants::MaxShortcutSize)
|
2020-08-14 07:32:15 +08:00
|
|
|
{
|
|
|
|
// If it matched any of the previous modifiers then reset that drop down
|
2021-05-07 16:16:31 +08:00
|
|
|
if (EditorHelpers::CheckRepeatedModifier(selectedCodes, selectedKeyCode))
|
2020-08-14 07:32:15 +08:00
|
|
|
{
|
|
|
|
// warn and reset the drop down
|
2021-05-07 16:16:31 +08:00
|
|
|
errorType = ShortcutErrorType::ShortcutCannotHaveRepeatedModifier;
|
2020-08-14 07:32:15 +08:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2021-04-27 03:01:38 +08:00
|
|
|
// If not, add a new drop down
|
2020-08-14 07:32:15 +08:00
|
|
|
dropDownAction = BufferValidationHelpers::DropDownAction::AddDropDown;
|
|
|
|
}
|
|
|
|
}
|
2021-05-07 16:16:31 +08:00
|
|
|
else if (Helpers::IsModifierKey(selectedKeyCode) && dropDownCount >= EditorConstants::MaxShortcutSize)
|
2020-08-14 07:32:15 +08:00
|
|
|
{
|
2021-04-27 03:01:38 +08:00
|
|
|
// If last drop down and a modifier is selected but there are already max drop downs: warn the user
|
2020-08-14 07:32:15 +08:00
|
|
|
// warn and reset the drop down
|
2021-05-07 16:16:31 +08:00
|
|
|
errorType = ShortcutErrorType::ShortcutMaxShortcutSizeOneActionKey;
|
2020-08-14 07:32:15 +08:00
|
|
|
}
|
2020-10-19 17:27:47 +08:00
|
|
|
else if (selectedKeyCode == 0)
|
2020-08-14 07:32:15 +08:00
|
|
|
{
|
2021-04-27 03:01:38 +08:00
|
|
|
// If None is selected but it's the last index: warn
|
2020-08-14 07:32:15 +08:00
|
|
|
// If it is a hybrid control and there are 2 drop downs then deletion is allowed
|
2021-05-07 16:16:31 +08:00
|
|
|
if (isHybridControl && dropDownCount == EditorConstants::MinShortcutSize)
|
2020-08-14 07:32:15 +08:00
|
|
|
{
|
|
|
|
// set delete drop down flag
|
|
|
|
dropDownAction = BufferValidationHelpers::DropDownAction::DeleteDropDown;
|
|
|
|
// do not delete the drop down now since there may be some other error which would cause the drop down to be invalid after removal
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
// warn and reset the drop down
|
2021-05-07 16:16:31 +08:00
|
|
|
errorType = ShortcutErrorType::ShortcutOneActionKey;
|
2020-08-14 07:32:15 +08:00
|
|
|
}
|
|
|
|
}
|
2020-10-19 17:27:47 +08:00
|
|
|
else if (selectedKeyCode == CommonSharedConstants::VK_DISABLED && dropDownIndex)
|
2020-10-02 20:36:36 +08:00
|
|
|
{
|
2021-04-27 03:01:38 +08:00
|
|
|
// Disable can not be selected if one modifier key has already been selected
|
2021-05-07 16:16:31 +08:00
|
|
|
errorType = ShortcutErrorType::ShortcutDisableAsActionKey;
|
2020-10-02 20:36:36 +08:00
|
|
|
}
|
2020-08-14 07:32:15 +08:00
|
|
|
// If none of the above, then the action key will be set
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2021-04-27 03:01:38 +08:00
|
|
|
// If it is not the last drop down
|
2021-05-07 16:16:31 +08:00
|
|
|
if (Helpers::IsModifierKey(selectedKeyCode))
|
2020-08-14 07:32:15 +08:00
|
|
|
{
|
|
|
|
// If it matched any of the previous modifiers then reset that drop down
|
2021-05-07 16:16:31 +08:00
|
|
|
if (EditorHelpers::CheckRepeatedModifier(selectedCodes, selectedKeyCode))
|
2020-08-14 07:32:15 +08:00
|
|
|
{
|
|
|
|
// warn and reset the drop down
|
2021-05-07 16:16:31 +08:00
|
|
|
errorType = ShortcutErrorType::ShortcutCannotHaveRepeatedModifier;
|
2020-08-14 07:32:15 +08:00
|
|
|
}
|
|
|
|
// If not, the modifier key will be set
|
|
|
|
}
|
2021-05-07 16:16:31 +08:00
|
|
|
else if (selectedKeyCode == 0 && dropDownCount > EditorConstants::MinShortcutSize)
|
2020-08-14 07:32:15 +08:00
|
|
|
{
|
2021-04-27 03:01:38 +08:00
|
|
|
// If None is selected and there are more than 2 drop downs
|
2020-08-14 07:32:15 +08:00
|
|
|
// set delete drop down flag
|
|
|
|
dropDownAction = BufferValidationHelpers::DropDownAction::DeleteDropDown;
|
|
|
|
// do not delete the drop down now since there may be some other error which would cause the drop down to be invalid after removal
|
|
|
|
}
|
2021-05-07 16:16:31 +08:00
|
|
|
else if (selectedKeyCode == 0 && dropDownCount <= EditorConstants::MinShortcutSize)
|
2020-08-14 07:32:15 +08:00
|
|
|
{
|
|
|
|
// If it is a hybrid control and there are 2 drop downs then deletion is allowed
|
2021-05-07 16:16:31 +08:00
|
|
|
if (isHybridControl && dropDownCount == EditorConstants::MinShortcutSize)
|
2020-08-14 07:32:15 +08:00
|
|
|
{
|
|
|
|
// set delete drop down flag
|
|
|
|
dropDownAction = BufferValidationHelpers::DropDownAction::DeleteDropDown;
|
|
|
|
// do not delete the drop down now since there may be some other error which would cause the drop down to be invalid after removal
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
// warn and reset the drop down
|
2021-05-07 16:16:31 +08:00
|
|
|
errorType = ShortcutErrorType::ShortcutAtleast2Keys;
|
2020-08-14 07:32:15 +08:00
|
|
|
}
|
|
|
|
}
|
2020-10-19 17:27:47 +08:00
|
|
|
else if (selectedKeyCode == CommonSharedConstants::VK_DISABLED && dropDownIndex)
|
2020-10-02 20:36:36 +08:00
|
|
|
{
|
2021-04-27 03:01:38 +08:00
|
|
|
// Allow selection of VK_DISABLE only in first dropdown
|
2021-05-07 16:16:31 +08:00
|
|
|
errorType = ShortcutErrorType::ShortcutDisableAsActionKey;
|
2020-10-02 20:36:36 +08:00
|
|
|
}
|
2020-08-14 07:32:15 +08:00
|
|
|
else if (dropDownIndex != 0 || isHybridControl)
|
|
|
|
{
|
2021-04-27 03:01:38 +08:00
|
|
|
// 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
|
2020-08-14 07:32:15 +08:00
|
|
|
bool isClear = true;
|
2023-02-08 19:01:13 +08:00
|
|
|
for (int i = dropDownIndex + 1; i < static_cast<int>(dropDownCount); i++)
|
2020-08-14 07:32:15 +08:00
|
|
|
{
|
2020-10-19 17:27:47 +08:00
|
|
|
if (selectedCodes[i] != -1)
|
2020-08-14 07:32:15 +08:00
|
|
|
{
|
|
|
|
isClear = false;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (isClear)
|
|
|
|
{
|
|
|
|
dropDownAction = BufferValidationHelpers::DropDownAction::ClearUnusedDropDowns;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
// warn and reset the drop down
|
2021-05-07 16:16:31 +08:00
|
|
|
errorType = ShortcutErrorType::ShortcutNotMoreThanOneActionKey;
|
2020-08-14 07:32:15 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2021-04-27 03:01:38 +08:00
|
|
|
// If there an action key is chosen on the first drop down and there are more than one drop down menus
|
2020-08-14 07:32:15 +08:00
|
|
|
// warn and reset the drop down
|
2021-05-07 16:16:31 +08:00
|
|
|
errorType = ShortcutErrorType::ShortcutStartWithModifier;
|
2020-08-14 07:32:15 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// After validating the shortcut, now for errors like remap to same shortcut, remap shortcut more than once, Win L and Ctrl Alt Del
|
2021-05-07 16:16:31 +08:00
|
|
|
if (errorType == ShortcutErrorType::NoError)
|
2020-08-14 07:32:15 +08:00
|
|
|
{
|
2020-10-09 02:28:24 +08:00
|
|
|
KeyShortcutUnion tempShortcut;
|
2020-10-19 17:27:47 +08:00
|
|
|
if (isHybridControl && KeyDropDownControl::GetNumberOfSelectedKeys(selectedCodes) == 1)
|
2020-08-14 07:32:15 +08:00
|
|
|
{
|
2021-06-02 00:15:16 +08:00
|
|
|
tempShortcut = (DWORD)*std::find_if(selectedCodes.begin(), selectedCodes.end(), [](int32_t a) { return a != -1 && a != 0; });
|
2020-08-14 07:32:15 +08:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
tempShortcut = Shortcut();
|
2020-10-19 17:27:47 +08:00
|
|
|
std::get<Shortcut>(tempShortcut).SetKeyCodes(selectedCodes);
|
2020-08-14 07:32:15 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
// Convert app name to lower case
|
|
|
|
std::transform(appName.begin(), appName.end(), appName.begin(), towlower);
|
2022-12-18 19:45:19 +08:00
|
|
|
std::wstring lowercaseDefAppName = KeyboardManagerEditorStrings::DefaultAppName();
|
2020-08-14 07:32:15 +08:00
|
|
|
std::transform(lowercaseDefAppName.begin(), lowercaseDefAppName.end(), lowercaseDefAppName.begin(), towlower);
|
|
|
|
if (appName == lowercaseDefAppName)
|
|
|
|
{
|
|
|
|
appName = L"";
|
|
|
|
}
|
|
|
|
|
|
|
|
// Check if the value being set is the same as the other column - index of other column does not have to be checked since only one column is hybrid
|
|
|
|
if (tempShortcut.index() == 1)
|
|
|
|
{
|
|
|
|
// If shortcut to shortcut
|
2023-02-08 19:01:13 +08:00
|
|
|
if (remapBuffer[rowIndex].first[std::abs(colIndex - 1)].index() == 1)
|
2020-08-14 07:32:15 +08:00
|
|
|
{
|
2023-02-08 19:01:13 +08:00
|
|
|
auto& shortcut = std::get<Shortcut>(remapBuffer[rowIndex].first[std::abs(colIndex - 1)]);
|
2021-05-07 16:16:31 +08:00
|
|
|
if (shortcut == std::get<Shortcut>(tempShortcut) && EditorHelpers::IsValidShortcut(shortcut) && EditorHelpers::IsValidShortcut(std::get<Shortcut>(tempShortcut)))
|
2020-08-14 07:32:15 +08:00
|
|
|
{
|
2021-05-07 16:16:31 +08:00
|
|
|
errorType = ShortcutErrorType::MapToSameShortcut;
|
2020-08-14 07:32:15 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// If one column is shortcut and other is key no warning required
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
// If key to key
|
2023-02-08 19:01:13 +08:00
|
|
|
if (remapBuffer[rowIndex].first[std::abs(colIndex - 1)].index() == 0)
|
2020-08-14 07:32:15 +08:00
|
|
|
{
|
2023-02-08 19:01:13 +08:00
|
|
|
DWORD otherColumnKeyCode = std::get<DWORD>(remapBuffer[rowIndex].first[std::abs(colIndex - 1)]);
|
2021-09-03 23:19:16 +08:00
|
|
|
DWORD shortcutKeyCode = std::get<DWORD>(tempShortcut);
|
|
|
|
if ((otherColumnKeyCode == shortcutKeyCode || IsKeyRemappingToItsCombinedKey(otherColumnKeyCode, shortcutKeyCode)) && otherColumnKeyCode != NULL && shortcutKeyCode != NULL)
|
2020-08-14 07:32:15 +08:00
|
|
|
{
|
2021-05-07 16:16:31 +08:00
|
|
|
errorType = ShortcutErrorType::MapToSameKey;
|
2020-08-14 07:32:15 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// If one column is shortcut and other is key no warning required
|
|
|
|
}
|
|
|
|
|
2021-05-07 16:16:31 +08:00
|
|
|
if (errorType == ShortcutErrorType::NoError && colIndex == 0)
|
2020-08-14 07:32:15 +08:00
|
|
|
{
|
|
|
|
// Check if the key is already remapped to something else for the same target app
|
|
|
|
for (int i = 0; i < remapBuffer.size(); i++)
|
|
|
|
{
|
|
|
|
std::wstring currAppName = remapBuffer[i].second;
|
|
|
|
std::transform(currAppName.begin(), currAppName.end(), currAppName.begin(), towlower);
|
|
|
|
|
|
|
|
if (i != rowIndex && currAppName == appName)
|
|
|
|
{
|
2021-05-07 16:16:31 +08:00
|
|
|
ShortcutErrorType result = ShortcutErrorType::NoError;
|
2020-08-14 07:32:15 +08:00
|
|
|
if (!isHybridControl)
|
|
|
|
{
|
2021-05-07 16:16:31 +08:00
|
|
|
result = EditorHelpers::DoShortcutsOverlap(std::get<Shortcut>(remapBuffer[i].first[colIndex]), std::get<Shortcut>(tempShortcut));
|
2020-08-14 07:32:15 +08:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
if (tempShortcut.index() == 0 && remapBuffer[i].first[colIndex].index() == 0)
|
|
|
|
{
|
|
|
|
if (std::get<DWORD>(tempShortcut) != NULL && std::get<DWORD>(remapBuffer[i].first[colIndex]) != NULL)
|
|
|
|
{
|
2021-05-07 16:16:31 +08:00
|
|
|
result = EditorHelpers::DoKeysOverlap(std::get<DWORD>(remapBuffer[i].first[colIndex]), std::get<DWORD>(tempShortcut));
|
2020-08-14 07:32:15 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
else if (tempShortcut.index() == 1 && remapBuffer[i].first[colIndex].index() == 1)
|
|
|
|
{
|
2021-05-07 16:16:31 +08:00
|
|
|
auto& shortcut = std::get<Shortcut>(remapBuffer[i].first[colIndex]);
|
|
|
|
if (EditorHelpers::IsValidShortcut(std::get<Shortcut>(tempShortcut)) && EditorHelpers::IsValidShortcut(shortcut))
|
2020-08-14 07:32:15 +08:00
|
|
|
{
|
2021-05-07 16:16:31 +08:00
|
|
|
result = EditorHelpers::DoShortcutsOverlap(std::get<Shortcut>(remapBuffer[i].first[colIndex]), std::get<Shortcut>(tempShortcut));
|
2020-08-14 07:32:15 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
// Other scenarios not possible since key to shortcut is with key to key, and shortcut to key is with shortcut to shortcut
|
|
|
|
}
|
2021-05-07 16:16:31 +08:00
|
|
|
if (result != ShortcutErrorType::NoError)
|
2020-08-14 07:32:15 +08:00
|
|
|
{
|
|
|
|
errorType = result;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-05-07 16:16:31 +08:00
|
|
|
if (errorType == ShortcutErrorType::NoError && tempShortcut.index() == 1)
|
2020-08-14 07:32:15 +08:00
|
|
|
{
|
2021-05-07 16:16:31 +08:00
|
|
|
errorType = EditorHelpers::IsShortcutIllegal(std::get<Shortcut>(tempShortcut));
|
2020-08-14 07:32:15 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return std::make_pair(errorType, dropDownAction);
|
|
|
|
}
|
|
|
|
}
|