class

InputRecorder

Captures raw input events into an in-memory buffer and flushes the buffer to disk on Stop(). Buffering avoids any file-I/O cost during gameplay — a 10-minute session at 60 fps with heavy input is well under 10 MB so the memory pressure is negligible. The recorder is owned by InputManager and receives forwarded events from the public On* sinks.

Module
Input
Header
#include "Input/InputRecorder.h"
Namespace
Mowo

Frame boundaries are explicit: InputManager calls EndFrame() once per game frame, which writes a FrameMarker into the stream. The marker is what playback uses to advance frame-by-frame, so missing one collapses two recorded frames into one on replay.

Public functions

ReturnsNameDescription
boolStartStarts buffering.
boolStopFlushes the buffer to disk.
boolIsActive
uint64_tFrameCountFrame counter incremented each EndFrame().
uint64_tEventCount
voidOnKeyDownEvent sinks — called by InputManager when this recorder is active.
voidOnKeyUp
voidOnCharInput
voidOnMouseButtonDown
voidOnMouseButtonUp
voidOnMouseMove
voidOnMouseScroll
voidOnMouseHorizontalScroll
voidOnMouseDelta
voidOnGamepadButtonDown
voidOnGamepadButtonUp
voidOnGamepadAxis
voidOnGamepadConnected
voidOnGamepadDisconnected
voidOnFingerDown
voidOnFingerMotion
voidOnFingerUp
voidOnFingerCanceled
voidEndFrameCloses the current frame.

Function details

Start

C++
bool Start(const std::string& outputPath)

Starts buffering. Returns false if outputPath resolves to a directory that doesn't exist (we don't auto-create). Existing files are silently overwritten on Stop().

Stop

C++
bool Stop()

Flushes the buffer to disk. Safe to call when not recording (no-op). Returns true if a file was written (i.e. Start() had been called).

IsActive

C++
bool IsActive() const

FrameCount

C++
uint64_t FrameCount() const

Frame counter incremented each EndFrame(). 0 before the first marker is written, so the count matches "number of frames fully captured".

EventCount

C++
uint64_t EventCount() const

OnKeyDown

C++
void OnKeyDown(int vkCode)

Event sinks — called by InputManager when this recorder is active. All record raw values, untouched (e.g. mouse positions stay in pixels, gamepad axes are pre-deadzone). Playback re-injects via the same sinks.

OnKeyUp

C++
void OnKeyUp(int vkCode)

OnCharInput

C++
void OnCharInput(uint32_t codepoint)

OnMouseButtonDown

C++
void OnMouseButtonDown(MouseButton button)

OnMouseButtonUp

C++
void OnMouseButtonUp(MouseButton button)

OnMouseMove

C++
void OnMouseMove(float x, float y)

OnMouseScroll

C++
void OnMouseScroll(float delta)

OnMouseHorizontalScroll

C++
void OnMouseHorizontalScroll(float delta)

OnMouseDelta

C++
void OnMouseDelta(float dx, float dy)

OnGamepadButtonDown

C++
void OnGamepadButtonDown(int index, GamepadButton button)

OnGamepadButtonUp

C++
void OnGamepadButtonUp(int index, GamepadButton button)

OnGamepadAxis

C++
void OnGamepadAxis(int index, GamepadAxis axis, float value)

OnGamepadConnected

C++
void OnGamepadConnected(int index)

OnGamepadDisconnected

C++
void OnGamepadDisconnected(int index)

OnFingerDown

C++
void OnFingerDown(uint64_t fingerId, float x, float y, float pressure)

OnFingerMotion

C++
void OnFingerMotion(uint64_t fingerId, float x, float y, float dx, float dy, float pressure)

OnFingerUp

C++
void OnFingerUp(uint64_t fingerId, float x, float y, float pressure)

OnFingerCanceled

C++
void OnFingerCanceled(uint64_t fingerId)

EndFrame

C++
void EndFrame()

Closes the current frame. InputManager calls this once per Update tick.

Generated from Input/InputRecorder.h via input.json · Nov 2, 2026Version 1.0.0