Skip to content
modkitv0.2

remote.h

#include <modkit/remote.h>3 functions

Remote control server for input injection via WebSocket.

When the MK_REMOTE_PORT environment variable is set, a WebSocket server starts on that port. External tools (e.g., modkit-mcp) can connect and send JSON commands to simulate input, query state, and take screenshots. This module is only available when MODKIT_HAS_NETWORKING is enabled. All functions are internal (called by platform.c), not user-facing.

Functions

mk_remote_initfunction

void mk_remote_init(void)

Initialize the remote control server.

Checks MK_REMOTE_PORT env var; starts WebSocket server if set. Called by platform.c after mk_input_init().

mk_remote_pollfunction

void mk_remote_poll(void)

Process queued remote commands and inject input.

Called by platform.c each frame, after mk_input_begin_frame() and before SDL_PollEvent().

mk_remote_shutdownfunction

void mk_remote_shutdown(void)

Shut down the remote control server.

Called by platform.c during shutdown.