tModLoader v0.11.8.9
A mod to make and play 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...
 

Properties

bool Current [get]
 Returns true if this hotkey is pressed currently. Useful for createing a behavior that relies on the hotkey being held down. More...
 
bool JustPressed [get]
 Returns true if this hotkey was just released this update. This is a fire-once-per-press behavior. More...
 
bool JustReleased [get]
 Returns true if this hotkey was just released this update. More...
 
bool Old [get]
 Returns true if this hotkey was pressed the previous update. More...
 
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

◆ GetAssignedKeys()

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[uniqueName];
32 }

Property Documentation

◆ Current

bool Terraria.ModLoader.ModHotKey.Current
get

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.

◆ JustPressed

bool Terraria.ModLoader.ModHotKey.JustPressed
get

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.

◆ JustReleased

bool Terraria.ModLoader.ModHotKey.JustReleased
get

Returns true if this hotkey was just released this update.

Definition at line 54 of file ModHotkey.cs.

◆ Old

bool Terraria.ModLoader.ModHotKey.Old
get

Returns true if this hotkey was pressed the previous update.

Definition at line 59 of file ModHotkey.cs.

◆ RetroCurrent

bool Terraria.ModLoader.ModHotKey.RetroCurrent
get

Definition at line 34 of file ModHotkey.cs.

34 {
35 get {
36 if (Main.drawingPlayerChat || Main.player[Main.myPlayer].talkNPC != -1 || Main.player[Main.myPlayer].sign != -1) return false;
37 return Current;
38 }
39 }
bool Current
Returns true if this hotkey is pressed currently. Useful for createing a behavior that relies on the ...
Definition: ModHotkey.cs:44