Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/The-Young-Maker/OpenMenuOS/llms.txt

Use this file to discover all available pages before exploring further.

OpenMenuOS ships five built-in popup types, each with a distinct color scheme, default icon, and interaction behavior. Choosing the right type ensures your UI communicates intent clearly without extra configuration. Every type is accessible through a one-line convenience method on PopupManager or through a PopupConfig struct when you need additional control.
Enum value: PopupType::INFO
Convenience method: PopupManager::showInfo(message, title)
Color scheme: Blue header
Default title: "Information"
Dismissal: Manual — stays open until the user presses OK.
Use INFO for neutral messages that give the user context without implying urgency.
PopupManager::showInfo(
  "This is an information message!",
  "Info Demo"
);
// Without a title — defaults to "Information"
PopupManager::showInfo("OpenMenuOS v3.1.0\nProfessional Menu System");

PopupResult enum

Every show* call and PopupManager::update() returns a PopupResult value. Use it to branch your sketch logic after the user interacts with a popup.
enum class PopupResult {
  NONE,   // No user interaction yet — popup still visible
  OK,     // User pressed OK or Yes
  CANCEL, // User pressed Cancel or No
  YES,    // Alias for OK (question dialogs)
  NO      // Alias for CANCEL (question dialogs)
};
NONE
PopupResult
Returned by update() on every iteration while the popup is still open and the user has not yet acted. Also returned immediately by all show* methods on the call that opens the popup.
OK
PopupResult
Returned when the user presses the OK or Yes button, or when auto-close fires.
CANCEL
PopupResult
Returned when the user presses the Cancel or No button.
YES
PopupResult
Alias for OK. Both values compare equal. Prefer OK in new code unless you are writing a question dialog and want the intent to be explicit.
NO
PopupResult
Alias for CANCEL. Both values compare equal. Prefer CANCEL in new code unless you are writing a question dialog and want the intent to be explicit.

Handling results in loop()

void loop() {
  PopupResult result = PopupManager::update();
  menu.loop();

  if (result != PopupResult::NONE) {
    switch (result) {
      case PopupResult::OK:
        Serial.println("User clicked OK/Yes");
        break;
      case PopupResult::CANCEL:
        Serial.println("User clicked Cancel/No");
        break;
      default:
        break;
    }
  }
}

Encoder navigation

When a rotary encoder is configured via menu.setEncoderPin(clk, dt), the popup system supports encoder-driven button selection:
  • Rotate the encoder to move the highlight between the OK and Cancel/No buttons.
  • Press the encoder button to confirm the highlighted selection.
This mirrors the button behavior you configure for general menu navigation — no additional setup is needed for popups.
// Enable encoder support (also activates encoder navigation in popups)
menu.setEncoderPin(5, 2);  // CLK, DT pins
menu.setSelectPin(19);     // Encoder push-button
Encoder support in popups is activated automatically as soon as you call menu.setEncoderPin(). No separate popup configuration is required.

Build docs developers (and LLMs) love