Skip to content

Commit 3df2cda

Browse files
committed
Added tests for mouse axis mappers.
1 parent 9584125 commit 3df2cda

File tree

3 files changed

+452
-2
lines changed

3 files changed

+452
-2
lines changed

Include/Xidi/Test/MockMouse.h

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,12 @@
1616
#include "ControllerTypes.h"
1717
#include "Mouse.h"
1818

19+
#include <array>
20+
#include <cstdint>
21+
#include <list>
22+
#include <optional>
23+
#include <unordered_map>
24+
1925

2026
namespace XidiTest
2127
{
@@ -35,6 +41,9 @@ namespace XidiTest
3541
/// Holds the state of the virtual mouse that is represented by this object.
3642
Xidi::BitSetEnum<EMouseButton> virtualMouseButtonState;
3743

44+
/// Holds the most recent virtual mouse movement contribution received from each opaque source identifier, one map per mouse axis.
45+
std::array<std::unordered_map<uint32_t, int>, (unsigned int)EMouseAxis::Count> virtualMouseMovementContributionBySource;
46+
3847

3948
public:
4049
// -------- CONSTRUCTION AND DESTRUCTION --------------------------- //
@@ -63,6 +72,12 @@ namespace XidiTest
6372
/// Upon completion, no virtual mouse is the target of any captures.
6473
void EndCapture(void);
6574

75+
/// Retrieves the most recent mouse movement contribution that was submitted from the specified source.
76+
/// @param [in] axis Mouse axis for which the movement contribution is being queried.
77+
/// @param [in] sourceIdentifier Opaque identifier for the source of the mouse movement event.
78+
/// @return Most recent mouse movement contribution from the specified source, if such a contribution exists.
79+
std::optional<int> GetMovementContributionFromSource(EMouseAxis axis, uint32_t sourceIdentifier) const;
80+
6681
/// Submits a mouse movement.
6782
/// @param [in] axis Mouse axis that is affected.
6883
/// @param [in] mouseMovementUnits Number of internal mouse movement units along the target mouse axis.

0 commit comments

Comments
 (0)