From 5dbca9c6ef76f5bca0780041632cf7f6ac73376a Mon Sep 17 00:00:00 2001 From: Rio Date: Wed, 21 May 2025 13:19:58 +1200 Subject: [PATCH 1/2] Document InputObject behavior in CAS action functions 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 --- .../engine/classes/ContextActionService.yaml | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/content/en-us/reference/engine/classes/ContextActionService.yaml b/content/en-us/reference/engine/classes/ContextActionService.yaml index a5325a909..3f5723737 100644 --- a/content/en-us/reference/engine/classes/ContextActionService.yaml +++ b/content/en-us/reference/engine/classes/ContextActionService.yaml @@ -149,25 +149,26 @@ methods: 1 string - The same string that was originally passed to BindAction† + The same string that was originally passed to BindAction. This allows + one function to handle multiple actions at once, if necessary. 2 Enum.UserInputState - The state of the input (Begin, Change, End or Cancel)* + The state of the input (Begin, Change, End or Cancel). Cancel is sent + if some input was in-progress and another action bound over the in-progress + input, or if the in-progress bound action was `Class.ContextActionService:UnbindAction()|unbound`. 3 InputObject - An object that contains information about the input (varies based on UserInputType) + An object that contains information about the input (varies based on + UserInputType). The InputObject sometimes won't match the inputs the action + was bound to: when the Cancel state is sent, this object will have KeyCode + `Enum.KeyCode.Unknown|Unknown` and UserInputType `Enum.UserInputType.None|None`. - † This allows one function to handle multiple actions at once, if - necessary. \*Cancel is sent if some input was in-progress and another - action bound over the in-progress input, or if the in-progress bound - action was `Class.ContextActionService:UnbindAction()|unbound`. - #### Action Bindings Stack Action bindings behave like a stack: if two actions are bound to the same From 50a626f6ae97184f26dbc4904a80693dd8240004 Mon Sep 17 00:00:00 2001 From: IgnisRBX <43388550+IgnisRBX@users.noreply.github.com> Date: Wed, 21 May 2025 11:54:23 -1000 Subject: [PATCH 2/2] Apply suggestions from code review --- .../engine/classes/ContextActionService.yaml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/content/en-us/reference/engine/classes/ContextActionService.yaml b/content/en-us/reference/engine/classes/ContextActionService.yaml index 3f5723737..84f5f1fc4 100644 --- a/content/en-us/reference/engine/classes/ContextActionService.yaml +++ b/content/en-us/reference/engine/classes/ContextActionService.yaml @@ -149,23 +149,23 @@ methods: 1 string - The same string that was originally passed to BindAction. This allows - one function to handle multiple actions at once, if necessary. + The same string that was originally passed to Class.ContextActionService:BindAction()|BindAction(). + This allows one function to handle multiple actions at once, if necessary. 2 Enum.UserInputState - The state of the input (Begin, Change, End or Cancel). Cancel is sent - if some input was in-progress and another action bound over the in-progress - input, or if the in-progress bound action was `Class.ContextActionService:UnbindAction()|unbound`. + The state of the input. Enum.UserInputState|Cancel is sent + if some input was in progress and another action bound over that in-progress + input, or if the in-progress bound action was unbound through Class.ContextActionService:UnbindAction()|UnbindAction(). 3 InputObject An object that contains information about the input (varies based on - UserInputType). The InputObject sometimes won't match the inputs the action - was bound to: when the Cancel state is sent, this object will have KeyCode - `Enum.KeyCode.Unknown|Unknown` and UserInputType `Enum.UserInputType.None|None`. + Enum.UserInputType). The Class.InputObject sometimes won't match the inputs the action + was bound to: when the Enum.UserInputState|Cancel state is sent, this object will be + Enum.KeyCode.Unknown and Enum.UserInputType.None.