RemapShortcut.h
1 #pragma once 2 #include "Shortcut.h" 3 #include "Modifiers.h" 4 #include <variant> 5 #include <vector> 6 7 // This class stores all the variables associated with each shortcut remapping 8 class RemapShortcut 9 { 10 public: 11 KeyShortcutTextUnion targetShortcut; 12 bool isShortcutInvoked; 13 14 Modifiers modifierKeysInvoked; 15 // This bool value is only required for remapping shortcuts to Disable 16 bool isOriginalActionKeyPressed; 17 18 RemapShortcut(const KeyShortcutTextUnion& sc) : 19 targetShortcut(sc), isShortcutInvoked(false), isOriginalActionKeyPressed(false) 20 { 21 } 22 23 RemapShortcut() : 24 targetShortcut(Shortcut()), isShortcutInvoked(false), isOriginalActionKeyPressed(false) 25 { 26 } 27 28 inline bool operator==(const RemapShortcut& sc) const 29 { 30 return targetShortcut == sc.targetShortcut && isShortcutInvoked == sc.isShortcutInvoked && modifierKeysInvoked == sc.modifierKeysInvoked; 31 } 32 33 bool RemapToKey() 34 { 35 return targetShortcut.index() == 0; 36 } 37 };