tModLoader v2024.03
A mod to make and play Terraria mods
KeybindLoader Class Reference

Inherits Loader.

Static Public Member Functions

static ModKeybind RegisterKeybind (Mod mod, string name, Keys defaultBinding)
 Registers a keybind with a name and defaultBinding . Use the returned ModKeybind to detect when buttons are pressed. More...
 
static ModKeybind RegisterKeybind (Mod mod, string name, string defaultBinding)
 Registers a keybind with a name and defaultBinding . Use the returned ModKeybind to detect when buttons are pressed. More...
 

Member Function Documentation

◆ RegisterKeybind() [1/2]

static ModKeybind KeybindLoader.RegisterKeybind ( Mod  mod,
string  name,
Keys  defaultBinding 
)
static

Registers a keybind with a name and defaultBinding . Use the returned ModKeybind to detect when buttons are pressed.

Parameters
modThe mod that this keybind will belong to. Usually, this would be your mod instance.
nameThe internal name of the keybind. The localization key "Mods.{ModName}.Keybinds.{KeybindName}.DisplayName" will be used for the display name.
It is recommended that this not have any spaces.
defaultBindingThe default binding.

◆ RegisterKeybind() [2/2]

static ModKeybind KeybindLoader.RegisterKeybind ( Mod  mod,
string  name,
string  defaultBinding 
)
static

Registers a keybind with a name and defaultBinding . Use the returned ModKeybind to detect when buttons are pressed.

Parameters
modThe mod that this keybind will belong to. Usually, this would be your mod instance.
nameThe internal name of the keybind. The localization key "Mods.{ModName}.Keybinds.{KeybindName}.DisplayName" will be used for the display name.
It is recommended that this not have any spaces.
defaultBindingThe default binding.