tModLoader  0.12 Alpha
A mod to make and play Terraria mods
Terraria.ModLoader.ModKeybind Class Reference

Represents a loaded input binding. It is suggested to access the keybind status only in ModPlayer.ProcessTriggers. More...

Public Member Functions

List< string > GetAssignedKeys (InputMode mode=InputMode.Keyboard)
 Gets the currently assigned keybindings. Useful for prompts, tooltips, informing users. More...
 

Properties

bool Current [get]
 Returns true if this keybind is pressed currently. Useful for creating a behavior that relies on the keybind being held down. More...
 
bool JustPressed [get]
 Returns true if this keybind has just been pressed this update. This is a fire-once-per-press behavior. More...
 
bool JustReleased [get]
 Returns true if this keybind has just been released this update. More...
 
bool Old [get]
 Returns true if this keybind has been pressed during the previous update. More...
 
bool RetroCurrent [get]
 

Detailed Description

Represents a loaded input binding. It is suggested to access the keybind status only in ModPlayer.ProcessTriggers.

Member Function Documentation

◆ GetAssignedKeys()

List<string> Terraria.ModLoader.ModKeybind.GetAssignedKeys ( InputMode  mode = InputMode.Keyboard)

Gets the currently assigned keybindings. Useful for prompts, tooltips, informing users.

Parameters
modeThe InputMode. Choose between InputMode.Keyboard and InputMode.XBoxGamepad

Property Documentation

◆ Current

bool Terraria.ModLoader.ModKeybind.Current
get

Returns true if this keybind is pressed currently. Useful for creating a behavior that relies on the keybind being held down.

◆ JustPressed

bool Terraria.ModLoader.ModKeybind.JustPressed
get

Returns true if this keybind has just been pressed this update. This is a fire-once-per-press behavior.

◆ JustReleased

bool Terraria.ModLoader.ModKeybind.JustReleased
get

Returns true if this keybind has just been released this update.

◆ Old

bool Terraria.ModLoader.ModKeybind.Old
get

Returns true if this keybind has been pressed during the previous update.