Repository navigation
Expand file tree
/
Copy pathKeybindLib.xml
More file actions
134 lines (134 loc) · 8.24 KB
/
Copy pathKeybindLib.xml
File metadata and controls
134 lines (134 loc) · 8.24 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
<?xml version="1.0"?>
<doc>
<assembly>
<name>KeybindLib</name>
</assembly>
<members>
<member name="T:KeybindLib.KeybindManager">
<summary>
Manages keybind registration for custom mod keybinds.
</summary>
</member>
<member name="T:KeybindLib.KeybindManager.KeyDetails">
<summary>An object containing all unique data associated to the keybind.</summary>
</member>
<member name="P:KeybindLib.KeybindManager.KeyDetails.DefaultKey">
<summary>The default key code for the keybind.</summary>
</member>
<member name="P:KeybindLib.KeybindManager.KeyDetails.KeyEnvironment">
<summary>The game environment where the keybind is active.</summary>
</member>
<member name="P:KeybindLib.KeybindManager.KeyDetails.KeyPressType">
<summary>When the keybind event should trigger.</summary>
</member>
<member name="P:KeybindLib.KeybindManager.KeyDetails.DisplayName">
<summary>Human-readable name shown in keybind configuration menu.</summary>
</member>
<member name="P:KeybindLib.KeybindManager.KeyDetails.DisplayCategory">
<summary>(optional, default: "Unknown Category") Human-readable category name shown in keybind configuration menu.</summary>
</member>
<member name="P:KeybindLib.KeybindManager.KeyDetails.UnityEvent">
<summary>A UnityEvent that runs when keybind conditions are met.</summary>
</member>
<member name="M:KeybindLib.KeybindManager.KeyDetails.#ctor(UnityEngine.KeyCode,KeybindLib.KeybindManager.KeyEnvironment,KeybindLib.KeybindManager.KeyPressType,System.String,System.String)">
<param name="defaultKey">The default key code for the keybind.</param>
<param name="keyEnvironment">The game environment where the keybind is active.</param>
<param name="keyPressType">When the keybind event should trigger.</param>
<param name="displayName">Human-readable name shown in keybind configuration menu.</param>
<param name="displayCategory">Human-readable category name shown in keybind configuration menu.</param>
<returns>An object containing all unique data associated to the keybind.</returns>
</member>
<member name="T:KeybindLib.KeybindManager.KeyPressType">
<summary> Limit what type of key press is needed to activate a keybind. </summary>
</member>
<member name="F:KeybindLib.KeybindManager.KeyPressType.OnKeyDown">
<summary>Triggered once when the key is pressed.</summary>
</member>
<member name="F:KeybindLib.KeybindManager.KeyPressType.OnKeyUp">
<summary>Triggered once when the key is let go.</summary>
</member>
<member name="F:KeybindLib.KeybindManager.KeyPressType.WhileKeyHeld">
<summary>Triggered constantly while the key is down using game's Update tick loop.</summary>
</member>
<member name="T:KeybindLib.KeybindManager.KeyEnvironment">
<summary> Limit what minimum game environment is needed for keybind press to be to activate. </summary>
</member>
<member name="F:KeybindLib.KeybindManager.KeyEnvironment.Any">
<summary>Do not limit to any environment</summary>
</member>
<member name="F:KeybindLib.KeybindManager.KeyEnvironment.TitleScreen">
<summary>Only permit on Title Screen</summary>
</member>
<member name="F:KeybindLib.KeybindManager.KeyEnvironment.InGameMenu">
<summary>Only permit while in game and in a menu</summary>
</member>
<member name="F:KeybindLib.KeybindManager.KeyEnvironment.InGame">
<summary>Only permit while in game and not in a menu</summary>
</member>
<member name="M:KeybindLib.KeybindManager.RegisterEvent(System.String,System.String,KeybindLib.KeybindManager.KeyDetails)">
<example>
<code>
KeyDetails testKeydetails = new KeyDetails(
KeyCode.F,
KeybindManager.KeyEnvironment.Any,
KeybindManager.KeyPressType.OnKeyDown,
"Test Keybind",
"Test Category"
);
KeybindManager.RegisterEvent("TestDeveloper.TestMod", "test_key", testKeydetails).AddListener(() =>
{
KeyCode currentKey = KeybindManager.GetKey("TestDeveloper.TestMod", "test_key");
Debug.Log($"{currentKey} was pressed!");
});
</code>
</example>
<param name="modId">The unique identifier of the mod registering the keybind.</param>
<param name="keyId">The unique identifier for the keybind within the mod.</param>
<param name="keyDetails">An object containing all unique data associated to the keybind.</param>
<returns>A UnityEvent that can be used to detect a keybind press when the keybind conditions are met.</returns>
</member>
<member name="M:KeybindLib.KeybindManager.UnregisterEvent(System.String,System.String)">
<summary>Removes a UnityEvent if it exists.</summary>
<param name="modId">The unique identifier of the mod that registered the keybind.</param>
<param name="keyId">The unique identifier for the keybind within the mod.</param>
</member>
<member name="M:KeybindLib.KeybindManager.GetKeyData(System.String,System.String)">
<summary>Gets raw key data if it exists.</summary>
<param name="modId">The unique identifier of the mod.</param>
<param name="keyId">The unique identifier for the keybind within the mod.</param>
<returns>Null/Default values if event's not present or, if event's present, returns a quadruple with the values ( Key's Event, Display Name , Key's environment , Key's Press Type )</returns>
</member>
<member name="M:KeybindLib.KeybindManager.GetAllActiveKeys">
<summary>Gets all active keybinds that are loaded.</summary>
<returns>A dictionary in this format <code>{modID1: [modKey1,modKey2,etc...], modID2: [modKey1,etc...]}</code>.</returns>
</member>
<member name="M:KeybindLib.KeybindManager.GetModActiveKeys(System.String)">
<summary>Gets all active keybinds for a mod that is loaded.</summary>
<param name="modId">The unique identifier of the mod.</param>
<returns>A list of keybinds loaded for the mod in this format <code>[modKey1,modKey2,etc...]</code>.</returns>
</member>
<member name="M:KeybindLib.KeybindManager.SetKey(System.String,System.String,UnityEngine.KeyCode)">
<summary>Sets or replaces the value for a keybind in mod's custom keybind config.</summary>
<param name="modId">The unique identifier of the mod.</param>
<param name="keyId">The unique identifier for the keybind within the mod.</param>
<param name="keyCode">The key code for the keybind.</param>
</member>
<member name="M:KeybindLib.KeybindManager.GetKey(System.String,System.String)">
<summary>Gets the value for a keybind in mod's custom keybind config.</summary>
<param name="modId">The unique identifier of the mod.</param>
<param name="keyId">The unique identifier for the keybind within the mod.</param>
<returns>KeyCode.None if key's not present or, if key's present, returns KeyCode for requested keybind.</returns>
</member>
<member name="M:KeybindLib.KeybindManager.HasKey(System.String,System.String)">
<summary>Returns if keybind exists.</summary>
<param name="modId">The unique identifier of the mod.</param>
<param name="keyId">The unique identifier for the keybind within the mod.</param>
<returns>true or false for if the key exists.</returns>
</member>
<member name="M:KeybindLib.KeybindManager.RemoveKey(System.String,System.String)">
<summary>Removes keybind if present.</summary>
<param name="modId">The unique identifier of the mod.</param>
<param name="keyId">The unique identifier for the keybind within the mod.</param>
</member>
</members>
</doc>