tModLoader v2024.08
A mod to make and play Terraria mods
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.
 
LocalizedText DisplayName [get]
 
bool JustPressed [get]
 Returns true if this keybind has just been pressed this update. This is a fire-once-per-press behavior.
 
bool JustReleased [get]
 Returns true if this keybind has just been released this update.
 
bool Old [get]
 Returns true if this keybind has been pressed during the previous update.
 
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 > 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