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

[WIP] Event System Implementation #971

Draft
wants to merge 10 commits into
base: main
Choose a base branch
from

Conversation

mikepparks
Copy link
Contributor

@mikepparks mikepparks commented Apr 14, 2024

The idea behind this event system is to implement system-wide notices when certain functions occur. This will allow for more reactive features and potentially improve cross-feature communication, while cutting back on or eliminating duplicate functionality.

Examples of usage:

  • On WebConfig restart, an event is triggered and the Display feature will change to a "Restarting" screen.
  • With rotary encoders, the direction of travel, as well as the encoder ID is sent in an event that could be used for adjusting turbo rate, or switching profiles.

To add events, the following is needed:

  • A new event enum value added to GPEventType in proto/enums.proto
  • An event header in headers/events
  • Event handlers can be registered with EventManager::getInstance().registerEventHandler(GP_EVENT_ID, GPEVENT_CALLBACK(this->handleEvent(event);));
  • Events can be fired with EventManager::getInstance().triggerEvent(new GPEventClass(...props...));

…om the rotary encoder addon and registers a listener in the turbo addon to listen for changes.
Basic handling of encoder events changing turbo shot counter
Added event triggering when changing profiles
Added event handling on display for profile changes
Added RestartScreen to catch restart events and display boot messaging
Changed button layout banner to support more than just profile changes
Added USB mount/unmount event handling to button layout
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

1 participant