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, raw) and a scrollable help dump.
Expects a file fluidsynth_help.txt alongside this module.
Functions
| CommandMenu:new () | Create a new command menu instance. |
| CommandMenu:toggle () | Toggle menu visibility and reset when hiding. |
| CommandMenu:keypressed (key) | Handle key presses. |
| CommandMenu:textinput (t) | Collect text input in input mode. |
| CommandMenu:wheelmoved (dx, dy) | Handle mouse wheel for scrolling help. |
| CommandMenu:draw (x, y) | Draw the menu or help overlay. |
Tables
| topics | Key-to-command mapping for numeric input modes. |
Functions
- CommandMenu:new ()
-
Create a new command menu instance.
Returns:
-
CommandMenu
- CommandMenu:toggle ()
- Toggle menu visibility and reset when hiding.
- CommandMenu:keypressed (key)
-
Handle key presses.
Returns a command string on Enter; nil otherwise.
Parameters:
- key
- CommandMenu:textinput (t)
-
Collect text input in input mode.
Parameters:
- t
- CommandMenu:wheelmoved (dx, dy)
-
Handle mouse wheel for scrolling help.
Parameters:
- dx number horizontal scroll (ignored)
- dy number vertical scroll (positive = up)
- CommandMenu:draw (x, y)
-
Draw the menu or help overlay.
Parameters:
- x number X-coordinate (default 50)
- y number Y-coordinate (default 50)