Skip to content

Repository files navigation

carp-input

A semantic, action-based input management library for the Carp programming language.

This library decouples raw hardware events (keys, mouse buttons, joystick axes) from game logic. Instead of checking if the "W" key is pressed, your game logic asks if the "MoveForward" action is active.

Features

  • Semantic Mapping: Map multiple raw inputs to a single named action.
  • Aggregation: Automatically handles multiple bindings for the same action (e.g., Spacebar OR Gamepad A for "Jump").
  • Analog & Digital: Supports binary buttons, analog axes, and mouse deltas.
  • Easy Rebinding: Update controls at runtime by modifying the binding list.

Installation

(load "git@github.com:carpentry-org/carp-input@master")

That includes the GLFW backend, which needs glfw3 visible to pkg-config. For the manager alone, with no window-library dependency:

(load "git@github.com:carpentry-org/carp-input@master" "input.carp")

Examples

See examples.md for usage examples, and the API documentation for the full reference.

License

MIT

About

A semantic, action-based input management library for Carp

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors