Merge pull request #252 from Laupetin/fix/gamepad-mouse-move-hook
Fix RawMouse patch making gamepad mouse move hook not getting called
This commit is contained in:
commit
6737106785
@ -1833,13 +1833,18 @@ namespace Components
|
|||||||
return gamePads[0].inUse;
|
return gamePads[0].inUse;
|
||||||
}
|
}
|
||||||
|
|
||||||
int Gamepad::CL_MouseEvent_Hk(const int x, const int y, const int dx, const int dy)
|
void Gamepad::OnMouseMove([[maybe_unused]] const int x, [[maybe_unused]] const int y, const int dx, const int dy)
|
||||||
{
|
{
|
||||||
if (dx != 0 || dy != 0)
|
if (dx != 0 || dy != 0)
|
||||||
{
|
{
|
||||||
gamePads[0].inUse = false;
|
gamePads[0].inUse = false;
|
||||||
gpad_in_use.setRaw(false);
|
gpad_in_use.setRaw(false);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
int Gamepad::CL_MouseEvent_Hk(const int x, const int y, const int dx, const int dy)
|
||||||
|
{
|
||||||
|
OnMouseMove(x, y, dx, dy);
|
||||||
|
|
||||||
// Call original function
|
// Call original function
|
||||||
return Utils::Hook::Call<int(int, int, int, int)>(0x4D7C50)(x, y, dx, dy);
|
return Utils::Hook::Call<int(int, int, int, int)>(0x4D7C50)(x, y, dx, dy);
|
||||||
|
@ -41,6 +41,8 @@ namespace Components
|
|||||||
public:
|
public:
|
||||||
Gamepad();
|
Gamepad();
|
||||||
|
|
||||||
|
static void OnMouseMove(int x, int y, int dx, int dy);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
static Game::ButtonToCodeMap_t buttonList[];
|
static Game::ButtonToCodeMap_t buttonList[];
|
||||||
static Game::StickToCodeMap_t analogStickList[4];
|
static Game::StickToCodeMap_t analogStickList[4];
|
||||||
|
@ -97,6 +97,7 @@ namespace Components
|
|||||||
Game::s_wmv->oldPos = curPos;
|
Game::s_wmv->oldPos = curPos;
|
||||||
ScreenToClient(Window::GetWindow(), &curPos);
|
ScreenToClient(Window::GetWindow(), &curPos);
|
||||||
|
|
||||||
|
Gamepad::OnMouseMove(curPos.x, curPos.y, dx, dy);
|
||||||
auto recenterMouse = Game::CL_MouseEvent(curPos.x, curPos.y, dx, dy);
|
auto recenterMouse = Game::CL_MouseEvent(curPos.x, curPos.y, dx, dy);
|
||||||
|
|
||||||
if (recenterMouse)
|
if (recenterMouse)
|
||||||
|
Loading…
Reference in New Issue
Block a user