Skip to main content

Input

Castrum lets you bind keys, mouse buttons, and gamepad controls to named actions. That way, your game can ask whether the player wants to move forward without caring whether they pressed W or pushed a stick. When you need the cursor position or scroll wheel instead, read it directly from the input snapshot.

Input Tutorial​

Try the input bindings demo from a development checkout. Run go run . in the demo directory to drive the tank with WASD, the arrow keys, or a gamepad.

How-to-guides​

Explanations​

Reference​

Browse the input package on pkg.go.dev for the published API. For the API in your checkout, run go doc github.com/Leonard-Atorough/castrum/input.