Terraria ModLoader  0.10.1.5
A framework for Terraria mods
Terraria.ModLoader.ModHotKey Class Reference

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

+ Collaboration diagram for Terraria.ModLoader.ModHotKey:

Public Member Functions

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

Public Attributes

bool Current => PlayerInput.Triggers.Current.KeyStatus[displayName]
 Returns true if this hotkey is pressed currently. Useful for createing a behavior that relies on the hotkey being held down. More...
 
bool JustPressed => PlayerInput.Triggers.JustPressed.KeyStatus[displayName]
 Returns true if this hotkey was just released this update. This is a fire-once-per-press behavior. More...
 
bool JustReleased => PlayerInput.Triggers.JustReleased.KeyStatus[displayName]
 Returns true if this hotkey was just released this update. More...
 
bool Old => PlayerInput.Triggers.Old.KeyStatus[displayName]
 Returns true if this hotkey was pressed the previous update. More...
 

Properties

bool RetroCurrent [get]
 

Detailed Description

Represents a loaded hotkey. It is suggested to access the hotkey status only in ModPlayer.ProcessTriggers.

Definition at line 11 of file ModHotkey.cs.

Member Function Documentation

List<string> Terraria.ModLoader.ModHotKey.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
Returns

Definition at line 30 of file ModHotkey.cs.

30  {
31  return PlayerInput.CurrentProfile.InputModes[mode].KeyStatus[displayName];
32  }

Member Data Documentation

bool Terraria.ModLoader.ModHotKey.Current => PlayerInput.Triggers.Current.KeyStatus[displayName]

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

Definition at line 44 of file ModHotkey.cs.

bool Terraria.ModLoader.ModHotKey.JustPressed => PlayerInput.Triggers.JustPressed.KeyStatus[displayName]

Returns true if this hotkey was just released this update. This is a fire-once-per-press behavior.

Definition at line 49 of file ModHotkey.cs.

bool Terraria.ModLoader.ModHotKey.JustReleased => PlayerInput.Triggers.JustReleased.KeyStatus[displayName]

Returns true if this hotkey was just released this update.

Definition at line 54 of file ModHotkey.cs.

bool Terraria.ModLoader.ModHotKey.Old => PlayerInput.Triggers.Old.KeyStatus[displayName]

Returns true if this hotkey was pressed the previous update.

Definition at line 59 of file ModHotkey.cs.

Property Documentation

bool Terraria.ModLoader.ModHotKey.RetroCurrent
get

Definition at line 34 of file ModHotkey.cs.