Module src.backends.fluidsynth.command_menu

Fluidsynth backend in‐game command menu.

Presents a simple overlay for selecting and sending MIDI control messages (tempo, speed, loop, seek, or raw) to a Fluidsynth server.

Functions

CommandMenu:new () Create a new command menu instance.
CommandMenu:toggle () Toggle visibility of the menu.
CommandMenu:keypressed (key) Handle a key press event.
CommandMenu:textinput (t) Collect text input in input mode.
CommandMenu:draw (x, y) Draw the command menu overlay.


Functions

CommandMenu:new ()
Create a new command menu instance. Initially hidden and in select mode.

Returns:

    CommandMenu New menu object
CommandMenu:toggle ()
Toggle visibility of the menu. When hiding, resets state back to select and clears text.
CommandMenu:keypressed (key)
Handle a key press event. In select mode, chooses a command or exits. In input mode, edits the text buffer or submits the command.

Parameters:

  • key string The key that was pressed

Returns:

    [nil] On Enter, returns the built command string; otherwise nil
CommandMenu:textinput (t)
Collect text input in input mode. Allows only valid numeric characters for a–d modes, and arbitrary text for raw mode.

Parameters:

  • t string The text input (single character)
CommandMenu:draw (x, y)
Draw the command menu overlay. Renders a semi-transparent background and the current menu text.

Parameters:

  • x number X-coordinate to start drawing (default 50)
  • y number Y-coordinate to start drawing (default 50)
generated by LDoc 1.5.0 Last updated 2025-09-04 12:20:37