Lua Hotkey - Fightcade

Fightcade 2 (and its underlying FFmpeg core) exposes a Lua API that hooks directly into the emulated input pipeline. Every frame, the emulator asks: "What buttons are pressed?" Your script can intercept, modify, or generate inputs before the game sees them.

The magic happens in two files you’ll place in your game’s configuration folder (e.g., Fightcade/emulator/ggpofba/config/):

Most hotkey logic lives in input.lua. Let’s build from scratch.

A true frame-step requires pausing and single-stepping:

local stepping = false
local function frame_advance_toggle()
    if not stepping then
        emu.pause()
        stepping = true
        console.print("Frame advance mode ON. Press hotkey again to step.")
    else
        emu.step()
    end
end

local function exit_frame_advance() stepping = false emu.unpause() end fightcade lua hotkey

emu.registerhotkey(58, frame_advance_toggle) -- F12 to step emu.registerhotkey(1, exit_frame_advance) -- Escape to exit

You cannot just drop the file and have it work; you must tell FBNeo to load it.

  • Via FightCade (Online/Rooms):

  • Here’s a complete input.lua you can adapt. It supports multiple hotkeys, per-key state tracking, and automatic macro cancellation.

    -- Fightcade Advanced Hotkey System
    local active_macro = nil
    local macro_frame = 0
    local last_keys = {}
    

    local macros = ["u"] = -- Shinkuu Hadoken trigger = "u", sequence = "down", "downright", "right", "down", "downright", "right", "punch1" , frame_duration = 2 -- each step lasts 2 frames , ["i"] = -- Quick double tap forward (dash) trigger = "i", sequence = "right", "right" , frame_duration = 1

    function input_frame() local current_keys = input.get_keys()

    -- Start new macros on rising edge
    for id, macro in pairs(macros) do
        if current_keys[macro.trigger] and not last_keys[macro.trigger] then
            active_macro =  
                macro = macro, 
                step = 1, 
                frame_in_step = 0,
                trigger_key = macro.trigger
    end
    end
    -- Update active macro
    if active_macro then
        -- Cancel if trigger key released
        if not current_keys[active_macro.trigger_key] then
            active_macro = nil
        else
            active_macro.frame_in_step = active_macro.frame_in_step + 1
            if active_macro.frame_in_step >= active_macro.macro.frame_duration then
                active_macro.frame_in_step = 0
                active_macro.step = active_macro.step + 1
            end
    if active_macro.step > #active_macro.macro.sequence then
                active_macro = nil
            else
                local btn = active_macro.macro.sequence[active_macro.step]
                input.set(btn, true)
            end
        end
    end
    last_keys = current_keys
    

    end

    To install, drop this into your game’s config/input.lua, edit the macros table, and restart Fightcade. Your hotkeys will be live immediately.

  • Test names by printing inputs each frame:
  • function frame()
      local i = input.get()
      for k,v in pairs(i) do
        if v then print(k) end
      end
    end
    emu.registerframecallback(frame)
    

    Create a new .lua file. Name it my_hotkeys.lua. You can place it directly in the fbneo folder or a subfolder called scripts.