diff options
| author | JMC47 <JMC4789@gmail.com> | 2021-04-01 01:05:00 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-04-01 01:05:00 -0400 |
| commit | ce8e87c64b271b13a30fbc898b59427d28876a81 (patch) | |
| tree | 969b78c3ba230a74bfc9d953427a65bfd4f50bed /Source/Core/InputCommon/ControllerInterface/DInput/DInputKeyboardMouse.h | |
| parent | 06439a2d40a06179633301e91ee85fa3059506fa (diff) | |
| parent | 28e880efb628598090c715a7783a8dcbbbf18d50 (diff) | |
Merge pull request #8747 from iwubcode/map-freelook
Support controlling Free Look via input bindings (motion controls, gamepad, etc!)
Diffstat (limited to 'Source/Core/InputCommon/ControllerInterface/DInput/DInputKeyboardMouse.h')
| -rw-r--r-- | Source/Core/InputCommon/ControllerInterface/DInput/DInputKeyboardMouse.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/Source/Core/InputCommon/ControllerInterface/DInput/DInputKeyboardMouse.h b/Source/Core/InputCommon/ControllerInterface/DInput/DInputKeyboardMouse.h index c3834df528..ceda59d02c 100644 --- a/Source/Core/InputCommon/ControllerInterface/DInput/DInputKeyboardMouse.h +++ b/Source/Core/InputCommon/ControllerInterface/DInput/DInputKeyboardMouse.h @@ -7,6 +7,7 @@ #include <windows.h> #include "Common/Matrix.h" +#include "InputCommon/ControllerInterface/ControllerInterface.h" #include "InputCommon/ControllerInterface/CoreDevice.h" #include "InputCommon/ControllerInterface/DInput/DInput8.h" @@ -14,14 +15,23 @@ namespace ciface::DInput { void InitKeyboardMouse(IDirectInput8* const idi8, HWND hwnd); +using RelativeMouseState = RelativeInputState<Common::TVec3<LONG>>; + class KeyboardMouse : public Core::Device { private: struct State { BYTE keyboard[256]; + + // Old smoothed relative mouse movement. DIMOUSESTATE2 mouse; + + // Normalized mouse cursor position. Common::TVec2<ControlState> cursor; + + // Raw relative mouse movement. + RelativeMouseState relative_mouse; }; class Key : public Input @@ -53,6 +63,7 @@ private: public: Axis(u8 index, const LONG& axis, LONG range) : m_axis(axis), m_range(range), m_index(index) {} std::string GetName() const override; + bool IsDetectable() const override { return false; } ControlState GetState() const override; private: |
