Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add controller buttons combo #116

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open

Conversation

k3kukua
Copy link
Contributor

@k3kukua k3kukua commented May 11, 2024

Combos - an easy way to keep track of controller button combinations.
Demo: "Додатки" -> "Тести" -> "Combo" (apps/demos/combo)

Classes:

  • ComboOneButton - tracking a single button press
  • ComboOneHoldDownButton - tracking the hold of a single button
  • ComboButtonSequence - tracking sequential button presses
  • ComboConcurrentButtons - tracking simultaneous button presses

Example:
Init:
ComboButtonSequence combo({Button::DOWN, Button::UP, Button::UP, Button::DOWN, Button::A, Button::B, Button::B, Button::A});
Optional use handler:
combo.setCompletedEventHandler(handler);
Using:
combo.loop(lilka::controller.getState());
Check combo status:
combo.isCompleted()

@and3rson
Copy link
Owner

and3rson commented Jun 5, 2024

@k3kukua Дякую за PR! Це гарний функціонал!
Чи можеш переглянути помилки? Там є деякі проблеми в коді, які потрібно виправити (див. результати clang-format і cppcheck)

@k3kukua
Copy link
Contributor Author

k3kukua commented Jun 7, 2024

@k3kukua Дякую за PR! Це гарний функціонал! Чи можеш переглянути помилки? Там є деякі проблеми в коді, які потрібно виправити (див. результати clang-format і cppcheck)

Виправлено

@black-ghost-off
Copy link
Collaborator

@k3kukua , check cppcheck again please

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.

None yet

3 participants