Line 8: |
Line 8: |
| # Run SMAPI at least once with the mod to let it generate its config file. | | # Run SMAPI at least once with the mod to let it generate its config file. |
| # Edit <tt>config.json</tt> in the mod's folder with a text editor. | | # Edit <tt>config.json</tt> in the mod's folder with a text editor. |
− | # Change the key options using [[#Available bindings|the values below]]. (On Mac, make sure it doesn't change to curly quotes.) | + | # Change the key options using [[#Button codes|the values below]]. (On Mac, make sure it doesn't change to curly quotes.) |
| | | |
| Note that some mods may not be configurable. | | Note that some mods may not be configurable. |
Line 16: |
Line 16: |
| | | |
| ===Find the code for a key=== | | ===Find the code for a key=== |
− | [[#Available bindings|''Available bindings'']] below shows all available key codes, but sometimes it's not clear which one applies (e.g. for non-English keyboards). Here's how to check: | + | [[#Button codes|''Button codes'']] below shows all available codes, but sometimes it's not clear which one applies (e.g. for non-English keyboards). Here's how to check: |
| | | |
| # Launch the game. | | # Launch the game. |
Line 36: |
Line 36: |
| # Add new buttons to the <tt>buttons</tt> field in the same format.<br />''Tip: when you add a button, set its <tt>X</tt> value to the previous button + 96.'' | | # Add new buttons to the <tt>buttons</tt> field in the same format.<br />''Tip: when you add a button, set its <tt>X</tt> value to the previous button + 96.'' |
| | | |
− | ==Available bindings== | + | ==Button codes== |
| ===Keyboard=== | | ===Keyboard=== |
| ; common keys | | ; common keys |
Line 389: |
Line 389: |
| |} | | |} |
| | | |
− | ==For modders== | + | ==Multi-key bindings== |
− | These constants are part of the [[Modding:Modder Guide/APIs/Input|SMAPI input events]], specifically SMAPI's <tt>SButton</tt> enum which unifies controller, keyboard, and mouse buttons.
| + | Mods using SMAPI 3.9+ features can support multi-key bindings. That lets you combine multiple [[#Button codes|button codes]] into a combo keybind, and list alternate keybinds. For example, <code>"LeftShoulder, LeftControl + S"</code> will apply if <tt>LeftShoulder</tt> is pressed, ''or'' if both <tt>LeftControl</tt> and <tt>S</tt> are pressed. |
| + | |
| + | Some things to keep in mind: |
| + | * The order doesn't matter, so <code>"LeftControl + S"</code> and <code>"S + LeftControl"</code> are equivalent. |
| + | * SMAPI doesn't prevent mods from using overlapping hotkeys. For example, if one mod uses <code>"S"</code> and the other mod uses <code>"LeftControl + S"</code>, pressing <tt>LeftControl</tt> and <tt>S</tt> will activate both. |
| | | |
| ==See also== | | ==See also== |
| * [[Controls]] for the game's default bindings | | * [[Controls]] for the game's default bindings |
| + | * [[Modding:Modder Guide/APIs/Input|SMAPI input events]] for mod authors |
| | | |
| [[de:Modding:Spieleranleitung/Tastenbelegung]] | | [[de:Modding:Spieleranleitung/Tastenbelegung]] |
| [[es:Modding:Guía_del_jugador/Enlaces_de_teclas]] | | [[es:Modding:Guía_del_jugador/Enlaces_de_teclas]] |