-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
osd/modules/input/input_dinput.cpp: Adjusted heuristics to work bette…
…r with newer DualShock/DualSense controllers.
- Loading branch information
Showing
2 changed files
with
25 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,6 +24,7 @@ | |
#include <mutex> | ||
#include <string> | ||
#include <string_view> | ||
#include <type_traits> | ||
#include <utility> | ||
|
||
#include <windows.h> | ||
|
@@ -87,17 +88,10 @@ class dinput_api_helper | |
template <typename T> | ||
HRESULT enum_attached_devices(int devclass, T &&callback) const | ||
{ | ||
struct helper | ||
{ | ||
static BOOL CALLBACK callback(LPCDIDEVICEINSTANCE instance, LPVOID ref) | ||
{ | ||
return (*reinterpret_cast<T *>(ref))(instance); | ||
} | ||
}; | ||
return m_dinput->EnumDevices( | ||
devclass, | ||
&helper::callback, | ||
reinterpret_cast<LPVOID>(&callback), | ||
&di_emun_devices_cb<std::remove_reference_t<T> >, | ||
LPVOID(&callback), | ||
DIEDFL_ATTACHEDONLY); | ||
} | ||
|
||
|
@@ -128,6 +122,12 @@ class dinput_api_helper | |
|
||
static std::string make_id(LPCDIDEVICEINSTANCE instance); | ||
|
||
template <typename T> | ||
static BOOL CALLBACK di_emun_devices_cb(LPCDIDEVICEINSTANCE instance, LPVOID ref) | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
cuavas
Author
Member
|
||
{ | ||
return (*reinterpret_cast<T *>(ref))(instance); | ||
} | ||
|
||
Microsoft::WRL::ComPtr<IDirectInput8> m_dinput; | ||
dynamic_module::ptr m_dinput_dll; | ||
}; | ||
|
enum
typo?