Skip to content

Commit 7e81db2

Browse files
Document InputObject behavior in CAS action functions (#1110)
## Changes - Document how the InputObject passed to a ContextActionService action function won't correspond to a bound input when the function is called with Cancel state. - Since every entry in the table of function parameters would have an extra detail/note about it, it seemed unnecessary to keep those notes outside of the table, so they have been put in to the table. ## Checks By submitting your pull request for review, you agree to the following: - [X] This contribution was created in whole or in part by me, and I have the right to submit it under the terms of this repository's open source licenses. - [X] I understand and agree that this contribution and a record of it are public, maintained indefinitely, and may be redistributed under the terms of this repository's open source licenses. - [X] To the best of my knowledge, all proposed changes are accurate. --------- Co-authored-by: IgnisRBX <[email protected]>
1 parent eedd672 commit 7e81db2

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

content/en-us/reference/engine/classes/ContextActionService.yaml

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -149,25 +149,26 @@ methods:
149149
<tr>
150150
<td>1</td>
151151
<td><code>string</code></td>
152-
<td>The same string that was originally passed to BindAction†</td>
152+
<td>The same string that was originally passed to <code>Class.ContextActionService:BindAction()|BindAction()</code>.
153+
This allows one function to handle multiple actions at once, if necessary.</td>
153154
</tr>
154155
<tr>
155156
<td>2</td>
156157
<td><code>Enum.UserInputState</code></td>
157-
<td>The state of the input (Begin, Change, End or Cancel)*</td>
158+
<td>The state of the input. <code>Enum.UserInputState|Cancel</code> is sent
159+
if some input was in progress and another action bound over that in-progress
160+
input, or if the in-progress bound action was unbound through <code>Class.ContextActionService:UnbindAction()|UnbindAction()</code>.</td>
158161
</tr>
159162
<tr>
160163
<td>3</td>
161164
<td><code>InputObject</code></td>
162-
<td>An object that contains information about the input (varies based on UserInputType)</td>
165+
<td>An object that contains information about the input (varies based on
166+
<code>Enum.UserInputType</code>). The <code>Class.InputObject</code> sometimes won't match the inputs the action
167+
was bound to: when the <code>Enum.UserInputState|Cancel</code> state is sent, this object will be
168+
<code>Enum.KeyCode.Unknown</code> and <code>Enum.UserInputType.None</code>.</td>
163169
</tr>
164170
</table>
165171
166-
† This allows one function to handle multiple actions at once, if
167-
necessary. \*Cancel is sent if some input was in-progress and another
168-
action bound over the in-progress input, or if the in-progress bound
169-
action was `Class.ContextActionService:UnbindAction()|unbound`.
170-
171172
#### Action Bindings Stack
172173
173174
Action bindings behave like a stack: if two actions are bound to the same

0 commit comments

Comments
 (0)