2020-04-09 00:11:58 +08:00
|
|
|
#pragma once
|
|
|
|
#include "Shortcut.h"
|
2020-07-24 07:43:49 +08:00
|
|
|
#include <variant>
|
2020-04-09 00:11:58 +08:00
|
|
|
|
|
|
|
// This class stores all the variables associated with each shortcut remapping
|
|
|
|
class RemapShortcut
|
|
|
|
{
|
|
|
|
public:
|
2020-10-09 02:28:24 +08:00
|
|
|
KeyShortcutUnion targetShortcut;
|
2020-04-09 00:11:58 +08:00
|
|
|
bool isShortcutInvoked;
|
|
|
|
ModifierKey winKeyInvoked;
|
2020-10-15 23:53:43 +08:00
|
|
|
// This bool value is only required for remapping shortcuts to Disable
|
|
|
|
bool isOriginalActionKeyPressed;
|
2020-04-09 00:11:58 +08:00
|
|
|
|
2020-10-09 02:28:24 +08:00
|
|
|
RemapShortcut(const KeyShortcutUnion& sc) :
|
2020-10-15 23:53:43 +08:00
|
|
|
targetShortcut(sc), isShortcutInvoked(false), winKeyInvoked(ModifierKey::Disabled), isOriginalActionKeyPressed(false)
|
2020-04-09 00:11:58 +08:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
RemapShortcut() :
|
2020-10-15 23:53:43 +08:00
|
|
|
targetShortcut(Shortcut()), isShortcutInvoked(false), winKeyInvoked(ModifierKey::Disabled), isOriginalActionKeyPressed(false)
|
2020-04-09 00:11:58 +08:00
|
|
|
{
|
|
|
|
}
|
2020-08-14 07:32:15 +08:00
|
|
|
|
|
|
|
inline bool operator==(const RemapShortcut& sc) const
|
|
|
|
{
|
|
|
|
return targetShortcut == sc.targetShortcut && isShortcutInvoked == sc.isShortcutInvoked && winKeyInvoked == sc.winKeyInvoked;
|
|
|
|
}
|
2021-09-04 13:49:13 +08:00
|
|
|
|
|
|
|
bool RemapToKey()
|
|
|
|
{
|
|
|
|
return targetShortcut.index() == 0;
|
|
|
|
}
|
2020-04-09 00:11:58 +08:00
|
|
|
};
|