Etterna 0.74.4
Loading...
Searching...
No Matches
InputHandler_DirectInput.h
1#ifndef INPUTHANDLER_DIRECTINPUT_H
2#define INPUTHANDLER_DIRECTINPUT_H
3
4#include "InputHandler.h"
5#include "RageUtil/Misc/RageThreads.h"
6#include <chrono>
7
8void
9DInput_ForceJoystickPollingInNextDevicesChangedCall();
10
11struct DIDevice;
13{
14 public:
17 void GetDevicesAndDescriptions(std::vector<InputDeviceInfo>& vDevicesOut);
18 wchar_t DeviceButtonToChar(DeviceButton button,
19 bool bUseCurrentKeyModifiers);
20 void Update();
21 bool DevicesChanged();
22 void WindowReset();
23
24 void ApplyTemporaryInputSettings() override;
25 void RemoveTemporaryInputSettings() override;
26
27 private:
28 RageThread m_InputThread;
29 bool m_bShutdown;
30 bool m_bTemporarySettingsApplied = false;
31
32 int m_iLastSeenNumHidDevices; // This changes first on plug/unplug
33 int m_iNumTimesLeftToPollForJoysticksChanged;
34 int m_iLastSeenNumJoysticks; // This changes sometime after
35 // m_iLastSeenNumHidDevices
36
37 void UpdatePolled(DIDevice& device,
38 const std::chrono::steady_clock::time_point& tm);
39 void UpdateBuffered(DIDevice& device,
40 const std::chrono::steady_clock::time_point& tm);
41 void PollAndAcquireDevices(bool bBuffered);
42
43 static int InputThread_Start(void* p)
44 {
45 ((InputHandler_DInput*)p)->InputThreadMain();
46 return 0;
47 }
48 void InputThreadMain();
49
50 void StartThread();
51 void ShutdownThread();
52};
53
54#endif
Definition InputHandler_DirectInput.h:13
A class designed to handle special input devices.
Definition InputHandler.h:23
Thread, mutex, semaphore, and event classes.
Definition RageThreads.h:155
Definition InputHandler_DirectInputHelper.h:46