{{newin|[[0.9.2]]|092|type=function}}
Saves the virtual gamepad mappings of all [[Joystick]]s that are [[Joystick:isGamepad|recognized]] as gamepads and have either been recently used or their gamepad bindings have been modified.

The mappings are stored as a string for use with [[love.joystick.loadGamepadMappings]].
== Function ==
Saves the gamepad mappings of all relevant joysticks to a file.
=== Synopsis ===
<source lang="lua">
mappings = love.joystick.saveGamepadMappings( filename )
</source>
=== Arguments ===
{{param|string|filename|The filename to save the mappings string to.}}
=== Returns ===
{{param|string|mappings|The mappings string that was written to the file.}}

== Function ==
Returns the mappings string without writing to a file.
=== Synopsis ===
<source lang="lua">
mappings = love.joystick.saveGamepadMappings( )
</source>
=== Arguments ===
None.
=== Returns ===
{{param|string|mappings|The mappings string.}}

== See Also ==
* [[parent::love.joystick]]
* [[love.joystick.loadGamepadMappings]]
* [[love.joystick.setGamepadMapping]]
* [[Joystick:getGamepadMapping]]
* [[Joystick:isGamepad]]
[[Category:Functions]]
{{#set:Description=Saves the virtual gamepad mappings of all recently-used [[Joystick]]s that are [[Joystick:isGamepad|recognized]] as gamepads.}}
== Other Languages ==
{{i18n|love.joystick.saveGamepadMappings}}