mirror of
https://github.com/love2d/love.git
synced 2026-08-19 20:19:42 +02:00
Use the joystick's name in new gamepad mappings, when possible. Resolves issue #1370.
This commit is contained in:
@@ -199,8 +199,18 @@ bool JoystickModule::setGamepadMapping(const std::string &guid, Joystick::Gamepa
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// Use a generic name if we have to create a new mapping string.
|
std::string name = "Controller";
|
||||||
mapstr = guid + ",Controller,";
|
|
||||||
|
for (love::joystick::Joystick *stick : joysticks)
|
||||||
|
{
|
||||||
|
if (stick->getGUID() == guid)
|
||||||
|
{
|
||||||
|
name = stick->getName();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
mapstr = guid + "," + name + ",";
|
||||||
}
|
}
|
||||||
|
|
||||||
std::stringstream joyinputstream;
|
std::stringstream joyinputstream;
|
||||||
|
|||||||
Reference in New Issue
Block a user