tModLoader v2023.01
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.
 
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 > 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