mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-07 11:46:30 +02:00
KBM - Set up tests for keyboard hook remapping logic (#4004)
* Add test proj, refactor proj with filters, and move single remap function to a separate header * Moved all methods to header files * remove more unused commented code * Reverted sln file * Fixed sln file * Added interface wrapping SendInput calls * fixed formatting * Created test mock class * Added keyboard input logic * Fixed compilation errors and added nuget reference to CppWinRT * Added tests for single key remapping * Refactored code for adding shortcut remap tests * Separated test classes * Fixed tests in release mode * Added more tests * Resolved comments
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
#include "../common/keyboard_layout.h"
|
||||
#include "../common/shared_constants.h"
|
||||
#include <interface/lowlevel_keyboard_event_data.h>
|
||||
#include "InputInterface.h"
|
||||
|
||||
// Enum type to store different states of the win key
|
||||
enum class ModifierKey
|
||||
@@ -167,10 +168,10 @@ public:
|
||||
void SetKeyCodes(const std::vector<DWORD>& keys);
|
||||
|
||||
// Function to check if all the modifiers in the shortcut have been pressed down
|
||||
bool CheckModifiersKeyboardState() const;
|
||||
bool CheckModifiersKeyboardState(InputInterface& ii) const;
|
||||
|
||||
// Function to check if any keys are pressed down except those in the shortcut
|
||||
bool IsKeyboardStateClearExceptShortcut() const;
|
||||
bool IsKeyboardStateClearExceptShortcut(InputInterface& ii) const;
|
||||
|
||||
// Function to get the number of modifiers that are common between the current shortcut and the shortcut in the argument
|
||||
int GetCommonModifiersCount(const Shortcut& input) const;
|
||||
|
||||
Reference in New Issue
Block a user