Skip to main content
Euca’s input layer (euca-input) is pure data: an InputState snapshot (pressed/just-pressed keys, mouse, scroll, gamepad), an ActionMap binding InputKeys to named actions, and an InputContextStack (Gameplay / Menu / Editor) that decides which bindings are active. It’s headless and serializable — InputSnapshot is used for networked replay.
The default headless server registers no ActionMap. The :3917 server creates the InputState and context stack, so /input/context/* work, but /input/bind silently no-ops and /input/list returns empty until an ActionMap resource exists. Input bindings are primarily a client/windowed-host concern; on a headless host you’d register the ActionMap yourself.

Context stack

curl -s -X POST http://localhost:3917/input/context/push \
  -H 'Content-Type: application/json' -d '{"context":"menu"}'
# {"ok":true,"message":"Pushed context 'menu'"}

curl -s http://localhost:3917/input/list
# {"count":0,"bindings":[]}   ← no ActionMap registered on the default server
/input/context/pop removes the top context (it won’t pop the last one).

What it does

  • BindingsActionMap::bind maps an InputKey (Key(name), mouse buttons, gamepad buttons/axes) to a named action; active_actions / just_started_actions query them.
  • Context stack — push/pop Gameplay / Menu / Editor to switch which bindings apply.
  • GamepadGamepadState tracks axes and buttons per gamepad id.
  • SnapshotsInputSnapshot::capture() / apply_to() for server-side replay.

Endpoints

MethodPathDescription
POST/input/bindBind a key/button to a named action
POST/input/unbindRemove a binding
GET/input/listList current bindings
POST/input/context/pushPush an input context
POST/input/context/popPop the top context

Status

  • ✅ Bindings, action maps, context stack, gamepad abstraction, input snapshots — shipped and headless.
  • 🟡 The default headless server doesn’t register an ActionMap (see the warning above).

Input endpoints

Bind, unbind, list, and context endpoints with schemas.