Skip to content

Add method to detect if any button is pressed.#10

Open
Chronos-W wants to merge 2 commits into
crosspoint-reader:mainfrom
Chronos-W:input-manager-add
Open

Add method to detect if any button is pressed.#10
Chronos-W wants to merge 2 commits into
crosspoint-reader:mainfrom
Chronos-W:input-manager-add

Conversation

@Chronos-W
Copy link
Copy Markdown

@Chronos-W Chronos-W commented May 17, 2026

Summary

  • What is the goal of this PR?
    Add additional isAnyPressed() to detect if any button is being pressed (X4)
  • What changes are included?
    Modified InputManager

Additional Context

Wanted to add some functionality to input management in CrossPoint, and noticed this can help. And already have wasAnyPressed() and wasAnyReleased().


AI Usage

While CrossPoint doesn't have restrictions on AI tools in contributing, please be transparent about their usage as it
helps set the right context for reviewers.

Did you use AI tools to help write this code? NO

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 17, 2026

Review Change Stack

📝 Walkthrough

Walkthrough

A new public iAnyPressed() const method is added to the InputManager class. The method reports whether any button was held during the last update() call by checking if the current button state is greater than zero.

Changes

InputManager iAnyPressed Method

Layer / File(s) Summary
Add iAnyPressed() method
libs/hardware/InputManager/include/InputManager.h, libs/hardware/InputManager/src/InputManager.cpp
New public const method iAnyPressed() declared and implemented to check whether any button is currently pressed by testing currentState > 0.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and specifically describes the main change: adding a method to detect if any button is pressed, which matches the implementation of the iAnyPressed() method.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description check ✅ Passed The PR description clearly describes the goal of adding an iAnyPressed() method to InputManager and mentions it complements existing input detection methods.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@libs/hardware/InputManager/include/InputManager.h`:
- Around line 24-29: The header declares bool iAnyPressed() const but the API
and naming convention use is* (e.g., isPressed) and callers expect
isAnyPressed(); rename the method declaration from iAnyPressed() to
isAnyPressed() in InputManager (update the function prototype in
InputManager.h), then update the corresponding implementation (e.g.,
InputManager::iAnyPressed -> InputManager::isAnyPressed) and any call sites or
tests that reference iAnyPressed so they use isAnyPressed instead.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 85f2824e-f992-4e8b-aa1b-d21814c58267

📥 Commits

Reviewing files that changed from the base of the PR and between 76a1b2f and ca7a8b3.

📒 Files selected for processing (2)
  • libs/hardware/InputManager/include/InputManager.h
  • libs/hardware/InputManager/src/InputManager.cpp
📜 Review details
🔇 Additional comments (1)
libs/hardware/InputManager/src/InputManager.cpp (1)

123-125: Method naming issue already noted in declaration.

This implementation should be renamed in lockstep with the header (iAnyPressedisAnyPressed).

Comment thread libs/hardware/InputManager/include/InputManager.h Outdated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant