mirror of
https://github.com/love2d/love.git
synced 2026-08-18 19:54:22 +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
|
||||
{
|
||||
// Use a generic name if we have to create a new mapping string.
|
||||
mapstr = guid + ",Controller,";
|
||||
std::string name = "Controller";
|
||||
|
||||
for (love::joystick::Joystick *stick : joysticks)
|
||||
{
|
||||
if (stick->getGUID() == guid)
|
||||
{
|
||||
name = stick->getName();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
mapstr = guid + "," + name + ",";
|
||||
}
|
||||
|
||||
std::stringstream joyinputstream;
|
||||
|
||||
Reference in New Issue
Block a user