Qt/Input: use 1-n in the GUI instead of 1-(n-1)

I didn't look into evdev
This commit is contained in:
Megamouse 2018-12-22 12:49:56 +01:00
parent 91d834ce73
commit 6e323622a5
4 changed files with 6 additions and 6 deletions

View file

@ -197,7 +197,7 @@ int xinput_pad_handler::GetDeviceNumber(const std::string& padId)
if (pos == std::string::npos)
return -1;
int device_number = std::stoul(padId.substr(pos + 12));
int device_number = std::stoul(padId.substr(pos + 12)) - 1; // Controllers 1-n in GUI
if (device_number >= XUSER_MAX_COUNT)
return -1;
@ -455,7 +455,7 @@ std::vector<std::string> xinput_pad_handler::ListDevices()
XINPUT_STATE state;
DWORD result = (*xinputGetState)(i, &state);
if (result == ERROR_SUCCESS)
xinput_pads_list.push_back(m_name_string + std::to_string(i));
xinput_pads_list.push_back(m_name_string + std::to_string(i + 1)); // Controllers 1-n in GUI
}
return xinput_pads_list;
}