mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-01-06 00:59:18 +00:00
mmjoy: fix connection update spam
This commit is contained in:
parent
df5af50866
commit
f7ec679242
@ -440,7 +440,8 @@ bool mm_joystick_handler::GetMMJOYDevice(int index, MMJOYDevice* dev)
|
||||
js_info.dwFlags = JOY_RETURNALL;
|
||||
joyGetDevCaps(index, &js_caps, sizeof(js_caps));
|
||||
|
||||
if (joyGetPosEx(index, &js_info) != JOYERR_NOERROR)
|
||||
dev->device_status = joyGetPosEx(index, &js_info);
|
||||
if (dev->device_status != JOYERR_NOERROR)
|
||||
return false;
|
||||
|
||||
char drv[32];
|
||||
@ -495,8 +496,10 @@ PadHandlerBase::connection mm_joystick_handler::update_connection(const std::sha
|
||||
if (!dev)
|
||||
return connection::disconnected;
|
||||
|
||||
MMRESULT status = joyGetPosEx(dev->device_id, &dev->device_info);
|
||||
if (status == JOYERR_NOERROR && GetMMJOYDevice(dev->device_id, dev.get()))
|
||||
const auto old_status = dev->device_status;
|
||||
dev->device_status = joyGetPosEx(dev->device_id, &dev->device_info);
|
||||
|
||||
if (dev->device_status == JOYERR_NOERROR && (old_status == JOYERR_NOERROR || GetMMJOYDevice(dev->device_id, dev.get())))
|
||||
{
|
||||
return connection::connected;
|
||||
}
|
||||
|
@ -92,6 +92,7 @@ class mm_joystick_handler final : public PadHandlerBase
|
||||
std::string device_name{ "" };
|
||||
JOYINFOEX device_info{};
|
||||
JOYCAPS device_caps{};
|
||||
MMRESULT device_status = JOYERR_UNPLUGGED;
|
||||
u64 trigger_left = 0;
|
||||
u64 trigger_right = 0;
|
||||
std::vector<u64> axis_left = { 0,0,0,0 };
|
||||
|
Loading…
Reference in New Issue
Block a user