Module src.backends.midiport.command_menu

midiport 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 midiport_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:

Returns:

    [nil]
CommandMenu:textinput (t)
Collect text input in input mode.

Parameters:

  • t string single character of text input
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)

Tables

topics
Key-to-command mapping for numeric input modes.

Fields:

  • a “player_tempo_bpm”
  • b “player_tempo_int”
  • c “player_loop”
  • d “player_seek”
generated by LDoc 1.5.0 Last updated 2025-12-06 11:03:56