tModLoader v2023.01
A mod to make and play Terraria mods
Terraria.ModLoader.KeybindLoader Class Reference

Inherits Terraria.ModLoader.Loader< T >.

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...
 

Additional Inherited Members

- Public Member Functions inherited from Terraria.ModLoader.Loader< T >
Get (int id)
 
int Register (T obj)
 
- Protected Member Functions inherited from Terraria.ModLoader.Loader< T >
int Reserve ()
 
- Properties inherited from Terraria.ModLoader.Loader< T >
int VanillaCount [get, set]
 

Member Function Documentation

◆ RegisterKeybind() [1/2]

static ModKeybind Terraria.ModLoader.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}.Keybind.{KeybindName}" will be used for the display name.
defaultBindingThe default binding.

◆ RegisterKeybind() [2/2]

static ModKeybind Terraria.ModLoader.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}.Keybind.{KeybindName}" will be used for the display name.
defaultBindingThe default binding.