TModLoader v1.4.4.9
TModLoader source code documentation
Loading...
Searching...
No Matches

◆ RegisterKeybind() [2/3]

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

Registers a keybind with a name and defaultBinding . Use the returned T:Terraria.ModLoader.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.

Definition at line 35 of file KeybindLoader.cs.

36 {
37 if (mod == null)
38 {
39 throw new ArgumentNullException("mod");
40 }
41 if (string.IsNullOrWhiteSpace(name))
42 {
43 throw new ArgumentNullException("name");
44 }
46 {
47 throw new ArgumentNullException("defaultBinding");
48 }
49 return RegisterKeybind(new ModKeybind(mod, name, defaultBinding));
50 }
static ModKeybind RegisterKeybind(Mod mod, string name, Keys defaultBinding)
Registers a keybind with a name and defaultBinding . Use the returned T:Terraria....

References Terraria.ModLoader.KeybindLoader.RegisterKeybind().

+ Here is the call graph for this function: