Skip to content

Commit

Permalink
Update dinput8
Browse files Browse the repository at this point in the history
  • Loading branch information
elishacloud committed Jun 26, 2024
1 parent a153cc4 commit 5635abf
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion External/dinputto8
Submodule dinputto8 updated 2 files
+1 −1 BuildNo.rc
+1 −1 IDirectInputX.cpp
8 changes: 4 additions & 4 deletions dinput8/IDirectInputDevice8.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ HRESULT m_IDirectInputDevice8::SetProperty(REFGUID rguidProp, LPCDIPROPHEADER pd
Logging::LogDebug() << __FUNCTION__ << " (" << this << ")";

// Handle mouse input
if (Config.FixHighFrequencyMouse && IsMouse)
if (IsMouse && Config.FixHighFrequencyMouse)
{
const DWORD dwMinBufferSize = 128;

Expand Down Expand Up @@ -135,7 +135,7 @@ HRESULT m_IDirectInputDevice8::GetDeviceState(DWORD cbData, LPVOID lpvData)
return ProxyInterface->GetDeviceState(cbData, lpvData);
}

HRESULT m_IDirectInputDevice8::FakeGetDeviceData(DWORD cbObjectData, LPDIDEVICEOBJECTDATA rgdod, LPDWORD pdwInOut, DWORD dwFlags)
HRESULT m_IDirectInputDevice8::GetMouseDeviceData(DWORD cbObjectData, LPDIDEVICEOBJECTDATA rgdod, LPDWORD pdwInOut, DWORD dwFlags)
{
// Check arguments
if (!pdwInOut || (rgdod && cbObjectData != sizeof(DIDEVICEOBJECTDATA) && cbObjectData != sizeof(DIDEVICEOBJECTDATA_DX3)))
Expand Down Expand Up @@ -316,9 +316,9 @@ HRESULT m_IDirectInputDevice8::GetDeviceData(DWORD cbObjectData, LPDIDEVICEOBJEC
}
}

if (Config.FixHighFrequencyMouse && IsMouse)
if (IsMouse && Config.FixHighFrequencyMouse)
{
return FakeGetDeviceData(cbObjectData, rgdod, pdwInOut, dwFlags);
return GetMouseDeviceData(cbObjectData, rgdod, pdwInOut, dwFlags);
}

return ProxyInterface->GetDeviceData(cbObjectData, rgdod, pdwInOut, dwFlags);
Expand Down
2 changes: 1 addition & 1 deletion dinput8/IDirectInputDevice8.h
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ class m_IDirectInputDevice8 : public IDirectInputDevice8A, public IDirectInputDe
STDMETHOD(Acquire)(THIS);
STDMETHOD(Unacquire)(THIS);
STDMETHOD(GetDeviceState)(THIS_ DWORD, LPVOID);
STDMETHOD(FakeGetDeviceData)(THIS_ DWORD, LPDIDEVICEOBJECTDATA, LPDWORD, DWORD);
STDMETHOD(GetMouseDeviceData)(THIS_ DWORD, LPDIDEVICEOBJECTDATA, LPDWORD, DWORD);
STDMETHOD(GetDeviceData)(THIS_ DWORD, LPDIDEVICEOBJECTDATA, LPDWORD, DWORD);
STDMETHOD(SetDataFormat)(THIS_ LPCDIDATAFORMAT);
STDMETHOD(SetEventNotification)(THIS_ HANDLE);
Expand Down

0 comments on commit 5635abf

Please sign in to comment.