Difference between revisions of "Modding:Player Guide/Key Bindings"

From Stardew Valley Wiki
Jump to navigation Jump to search
(group how-to sections)
(→‎How to…: + use key bindings on Android)
Line 14: Line 14:
 
===Disable a mod's key binding===
 
===Disable a mod's key binding===
 
For mods using SMAPI 2.0+ features, you can use <tt>None</tt> to disable a key binding.
 
For mods using SMAPI 2.0+ features, you can use <tt>None</tt> to disable a key binding.
 +
 +
===Use key bindings on Android===
 +
You can [[#Mobile|bind physical mobile buttons]], but there aren't many available. [[Modding:Installing SMAPI on Android|SMAPI on Android]] includes a Virtual Keyboard mod which lets you add on-screen buttons you can tap to send keyboard input to your installed mods.
 +
 +
To use the virtual keyboard:
 +
# In-game, a keyboard icon should appear in the top-left corner of the screen.
 +
# Tap the keyboard icon to show the configured buttons.
 +
# Tap the button to send.
 +
 +
To add a new key:
 +
# Run the game once to generate the default <tt>config.json</tt> file.
 +
# Open the <tt>Mods/VirtualKeyboard/config.json</tt> file in a text editor.
 +
# 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.''
  
 
==Reserved bindings==
 
==Reserved bindings==

Revision as of 22:29, 16 February 2020

Modding:Player Guide/header

Some mods let you edit key bindings, which are controller/keyboard/mouse buttons which do something in-game. This page explains how to configure them.

How to…

Configure a mod's bindings

  1. Install the mod (see help).
  2. Run SMAPI at least once with the mod to let it generate its config file.
  3. Edit config.json in the mod's folder with a text editor.
  4. Change the key options using the values below. (On Mac, make sure it doesn't change to curly quotes.)

Note that some mods may not be configurable.

Disable a mod's key binding

For mods using SMAPI 2.0+ features, you can use None to disable a key binding.

Use key bindings on Android

You can bind physical mobile buttons, but there aren't many available. SMAPI on Android includes a Virtual Keyboard mod which lets you add on-screen buttons you can tap to send keyboard input to your installed mods.

To use the virtual keyboard:

  1. In-game, a keyboard icon should appear in the top-left corner of the screen.
  2. Tap the keyboard icon to show the configured buttons.
  3. Tap the button to send.

To add a new key:

  1. Run the game once to generate the default config.json file.
  2. Open the Mods/VirtualKeyboard/config.json file in a text editor.
  3. Add new buttons to the buttons field in the same format.
    Tip: when you add a button, set its X value to the previous button + 96.

Reserved bindings

You can't use the key bound to the chat box in multiplayer (default T).

Available bindings

Keyboard

Keyboard bindings are supported by virtually all configurable mods.

common keys
value description
A through Z The letter keys.
D0 through D9 The number keys.
Down, Left,
Right, Up
The arrow keys.
F1 through F24 The function keys.
Apps The applications or menu () key, typically located next to your right CTRL key.
Back The backspace ( or ) key.
CapsLock The CAPS LOCK or key.
Enter The ENTER or key.
Escape The ESC key.
LeftAlt, RightAlt The ALT keys.
LeftControl, RightControl The CTRL key.
LeftShift, RightShift The SHIFT or keys.
LeftWindows, RightWindows The Windows keys.
OemCloseBrackets The ] key.
OemComma The , key.
OemMinus The - key.
OemOpenBrackets The [ key.
OemPeriod The . key.
OemPipe The | key.
OemPlus The + key.
OemQuestion The ? key on a US standard keyboard.
OemQuotes The ' or " key on a US standard keyboard.
OemSemicolon The ; key on a US standard keyboard.
OemTilde The ~ key on a US standard keyboard.
Space The space bar.
Tab

Subtract Subtract key Tab TAB key

numeric pad
value description
Numpad0 through Numpad9 The numpad number keys.
Add The + numpad key.
Subtract The - numpad key.
Divide The / numpad key.
Multiply The * numpad key.
NumLock The numeric lock, NUMLOCK, NUMLK, or NUM key.
control keys (above arrow keys)
value description
Delete The DEL key.
End The END key.
Insert The INS key.
PageDown, PageUp The PAGE UP and PAGE DOWN keys.
Pause The PAUSE key.
PrintScreen The PRT SCR key.
Scroll The SCR LK key.
uncommon keys
value description
BrowserBack The browser back key.
BrowserFavorites The browser favorites key.
BrowserForward The browser forward key.
BrowserHome The browser start and home key.
BrowserRefresh The browser refresh key.
BrowserSearch The browser search key.
BrowserStop The browser stop key.
ChatPadGreen The green ChatPad key.
ChatPadOrange The orange ChatPad key.
Crsel The cursor select key.
Decimal The decimal key.
EraseEof The erase EOF key.
Execute The execute key.
Exsel The execute selection key.
Help The help key.
Home The home key.
ImeConvert The IME convert key.
ImeNoConvert The IME no-convert key.
Kana The Kana key on Japanese keyboards.
Kanji The Kanji key on Japanese keyboards.
LaunchApplication1 The Start Application 1 key.
LaunchApplication2 The Start Application 2 key.
LaunchMail The Start Mail key.
MediaNextTrack The Next Track key.
MediaPlayPause The Play/Pause Media key.
MediaPreviousTrack The Previous Track key.
MediaStop The Stop Media key.
Oem8 Varies by keyboard.
OemAuto OEM Auto key.
OemBackslash The The OEM angle bracket or backslash key on the RT 102 key keyboard.
OemClear The OEM clear key.
OemCopy The OEM copy key.
OemEnlW The OEM Enlarge Window key.
PA1 The PA1 key.
Play The play key.
Print The PRINT key.
ProcessKey The IME process key.
Select The select key.
SelectMedia The select media key.
Separator The separator key.
Sleep The computer sleep key.
VolumeDown, VolumeUp The volume down/up keys.
VolumeMute The volume mute keys.
Zoom The zoom key.

Controller

Controller bindings are supported by mods using SMAPI 2.0+ features, and some older mods.

value description
ControllerA, ControllerB,
ControllerX, ControllerY
The main buttons.
ControllerBack The 'BACK' button on an XBox controller.
ControllerStart The 'START' button.
BigButton The 'big button' on the XBox Big Button controller.
DPadDown, DPadLeft
DPadRight, DPadUp
The directional pad buttons.
LeftShoulder, RightShoulder The bumper (shoulder) buttons.
LeftStick, RightStick The left/right thumbsticks when pressed as a button.
LeftThumbstickDown, LeftThumbstickLeft,
LeftThumbstickRight, LeftThumbstickUp
The left thumbstick when pushed in a direction.
LeftTrigger, RightTrigger The trigger buttons.
RightThumbstickDown, RightThumbstickLeft,
RightThumbstickRight, RightThumbstickUp
The right thumbstick when pushed in a direction.

Mouse

Mouse bindings are supported by mods using SMAPI 2.0+ features.

value description
MouseLeft The left mouse button.
MouseRight The right mouse button.
MouseMiddle The middle mouse button.
MouseX1, MouseX2 The extended mouse buttons (varies by mouse).

Mobile

Mobile device bindings are supported by mods using SMAPI 2.0+ features.

value description
VolumeUp, VolumeDown The volume up/down buttons.

For modders

These constants are part of the SMAPI input events, specifically SMAPI's SButton enum which unifies controller, keyboard, and mouse buttons.

See also

  • Controls for the game's default bindings