mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-07 11:46:30 +02:00
* Modify shortcut to key code more similar to shortcut to shortcuts code. Manually tested cases * Fixed existing tests and fixed scenario with other keys pressed and action key released * Fixed dummy key usage * Updated comments and removed dummy key usage in key to shortcut remaps * Added tests for disable and shortcut to key. Pending tests for dummy key * Added test cases for each usage of dummy key event * Remove redundant check
30 lines
965 B
C++
30 lines
965 B
C++
#pragma once
|
|
#include "Shortcut.h"
|
|
#include <variant>
|
|
|
|
// This class stores all the variables associated with each shortcut remapping
|
|
class RemapShortcut
|
|
{
|
|
public:
|
|
KeyShortcutUnion targetShortcut;
|
|
bool isShortcutInvoked;
|
|
ModifierKey winKeyInvoked;
|
|
// This bool value is only required for remapping shortcuts to Disable
|
|
bool isOriginalActionKeyPressed;
|
|
|
|
RemapShortcut(const KeyShortcutUnion& sc) :
|
|
targetShortcut(sc), isShortcutInvoked(false), winKeyInvoked(ModifierKey::Disabled), isOriginalActionKeyPressed(false)
|
|
{
|
|
}
|
|
|
|
RemapShortcut() :
|
|
targetShortcut(Shortcut()), isShortcutInvoked(false), winKeyInvoked(ModifierKey::Disabled), isOriginalActionKeyPressed(false)
|
|
{
|
|
}
|
|
|
|
inline bool operator==(const RemapShortcut& sc) const
|
|
{
|
|
return targetShortcut == sc.targetShortcut && isShortcutInvoked == sc.isShortcutInvoked && winKeyInvoked == sc.winKeyInvoked;
|
|
}
|
|
};
|