Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
28640eb
Comment out the shortcutKeysConsume input setting.
Darren-Kelly-Unity Mar 17, 2026
1eef02c
Add progress with solution for priority order for conflicting shortcuts.
Darren-Kelly-Unity Mar 19, 2026
d4c1f3f
Add progress with investigation to switch to priority calculation.
Darren-Kelly-Unity Mar 20, 2026
675afce
Implement binding priority feature in Input System, including UI supp…
Darren-Kelly-Unity Mar 23, 2026
3ea57de
Add priority to Actions instead of bindings.
Darren-Kelly-Unity Mar 23, 2026
fb68220
Add input actions asset.
Darren-Kelly-Unity Mar 23, 2026
423c64e
Revert "Comment out the shortcutKeysConsume input setting."
Darren-Kelly-Unity Mar 23, 2026
cc7adfe
Add better setup.
Darren-Kelly-Unity Mar 23, 2026
9cb60d1
priority is currently zero by default
K-Tone Mar 23, 2026
fa1afac
simplify just a wee bit
K-Tone Mar 24, 2026
51df2ef
Add progress with setting up tests.
Darren-Kelly-Unity Mar 25, 2026
ec0683b
Add current progress with test creation.
Darren-Kelly-Unity Mar 26, 2026
c97af36
Add the first working test!!
Darren-Kelly-Unity Mar 26, 2026
762e1ed
Add second working test.
Darren-Kelly-Unity Mar 26, 2026
7237d8e
Add new test with repeated binding press to be sure it doesn't trigge…
Darren-Kelly-Unity Mar 27, 2026
eddb699
Add test cases for all that I could think of.
Darren-Kelly-Unity Mar 27, 2026
b7d5a5d
Fix broken test due to shortcutKeysConsumeInput setting.
Darren-Kelly-Unity Mar 30, 2026
29aaa21
Add progress with refactoring tests to be more streamlined / re-usabl…
Darren-Kelly-Unity Apr 1, 2026
86d55b1
Add progress with converting / refactoring tests to use TestCaseSource.
Darren-Kelly-Unity Apr 2, 2026
7836085
Fix two broken tests due to key ordering of presses.
Darren-Kelly-Unity Apr 2, 2026
ca4c908
Add new test case that passes even though I wouldn't expect it to.
Darren-Kelly-Unity Apr 2, 2026
707433a
Update tests and remove redundant test.
Darren-Kelly-Unity Apr 2, 2026
8484453
Add test cleanup.
Darren-Kelly-Unity Apr 7, 2026
6640bde
Add fix for priorites of the same level not both firing.
Darren-Kelly-Unity Apr 7, 2026
18a234c
Cleanup tests & remove the need for the shortcutkeysconsume input set…
Darren-Kelly-Unity Apr 8, 2026
808decb
Add ignored failing test.
Darren-Kelly-Unity Apr 8, 2026
4c06cc6
Fix broken tests after changes to complexity.
Darren-Kelly-Unity Apr 8, 2026
0f167e4
RefactorInputStateMonitor's so it's no longer a partial class with th…
Darren-Kelly-Unity Apr 8, 2026
7cb004e
Add small cleanup of test code.
Darren-Kelly-Unity Apr 8, 2026
05aed76
Fix naming for complexity to priority in UnmanagedMemory struct.
Darren-Kelly-Unity Apr 9, 2026
848b486
Fix failing test.
Darren-Kelly-Unity Apr 9, 2026
22d5cf7
Add a small refactor to InputActionState & some tests for the area.
Darren-Kelly-Unity Apr 9, 2026
64d3aed
Add missing InputActionStateMonitorIndex file from last commit.
Darren-Kelly-Unity Apr 10, 2026
5898640
Fix failing test for DefaultInputActions.
Darren-Kelly-Unity Apr 10, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
615 changes: 615 additions & 0 deletions Assets/InputSystem_Actions.inputactions

Large diffs are not rendered by default.

14 changes: 14 additions & 0 deletions Assets/InputSystem_Actions.inputactions.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

48 changes: 48 additions & 0 deletions Assets/Samples/ProjectWideActions/ProjectWideActionsExample.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ public class ProjectWideActionsExample : MonoBehaviour
InputAction previous;
InputAction sprint;
InputAction crouch;
InputAction b;
InputAction shiftB;

// Start is called before the first frame update
void Start()
Expand All @@ -29,6 +31,8 @@ void Start()
previous = InputSystem.actions.FindAction("Player/Previous");
sprint = InputSystem.actions.FindAction("Player/Sprint");
crouch = InputSystem.actions.FindAction("Player/Crouch");
b = InputSystem.actions.FindAction("Player/B");
shiftB = InputSystem.actions.FindAction("Player/Shift B");
}
else
{
Expand All @@ -41,6 +45,18 @@ void Start()
attack.performed += OnAttack;
attack.canceled += OnCancel;
}

if (b != null)
{
b.performed += OnB;
b.canceled += OnCancel;
}

if (shiftB != null)
{
shiftB.performed += OnShiftB;
shiftB.canceled += OnCancel;
}
}

private void OnAttack(InputAction.CallbackContext ctx)
Expand All @@ -53,13 +69,35 @@ private void OnCancel(InputAction.CallbackContext ctx)
cube.GetComponent<Renderer>().material.color = Color.green;
}

private void OnB(InputAction.CallbackContext ctx)
{
Debug.Log("B WAS PRESSED");
cube.GetComponent<Renderer>().material.color = Color.yellow;
}

private void OnShiftB(InputAction.CallbackContext ctx)
{
Debug.Log("SHIFT + B WAS PRESSED");
cube.GetComponent<Renderer>().material.color = Color.blue;
}

void OnDestroy()
{
if (attack != null)
{
attack.performed -= OnAttack;
attack.canceled -= OnCancel;
}
if (b != null)
{
b.performed -= OnB;
b.canceled -= OnCancel;
}
if (shiftB != null)
{
shiftB.performed -= OnShiftB;
shiftB.canceled -= OnCancel;
}
}

// Update is called once per frame
Expand All @@ -71,6 +109,16 @@ void Update()
var moveVal = move.ReadValue<Vector2>() * 10.0f * Time.deltaTime;
cube.transform.Translate(new Vector3(moveVal.x, moveVal.y, 0));
}

if (shiftB.IsPressed())
{
Debug.Log("SHIFT + B WAS PRESSED");
}

if (b.IsPressed())
{
Debug.Log("B WAS PRESSED");
}
Comment on lines +113 to +121
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high
These calls to IsPressed() lack null checks. Since shiftB and b are resolved via FindAction in Start and are guarded by null checks elsewhere (lines 49 and 55), they could potentially be null. Accessing them here without a check will cause a NullReferenceException every frame if the actions are missing from the asset.

Additionally, polling IsPressed() and logging here spams the console every frame while the keys are held. This is likely redundant since the same messages are already logged once per press via the event callbacks (OnB, OnShiftB).

🤖 Helpful? 👍/👎

}
} // class ProjectWideActionsExample
} // namespace UnityEngine.InputSystem.Samples.ProjectWideActions
Loading