--- tags: - engine - input --- # Input - **`InputState`:** per frame, it tracks keys (pressed, held, released), the mouse position and buttons, wheel and drag deltas. It's rebuilt from SDL events in `PumpSdlEvents`. - **`ActionMap`:** maps keys and buttons to named actions (`Cancel`, `EndTurn`, `SpeedUp`, `RotateCamera`, …). Rebindable and saved with settings. - **ImGui gating:** when ImGui wants the mouse or keyboard, game input sees nothing. - **Picking helpers:** screen → ray → ground plane. See [[Rendering#Picking]]. Converting a hit to a tile is game code. - **Card drag and drop and hover** are game UI built on `InputState` plus tweens ([[Main Loop and Time#Timers and tweens]]). Input runs on `FrameClock`, so it works during the paused planning phase.