# @nebula/core-input

Action-based input abstraction for controller-first apps. Convert raw device events into app-level actions.

## Why it exists
Controller-focused apps should reason in terms of actions (confirm, back, pause) rather than physical inputs. This package lets you plug in your own device adapters and map them to actions consistently.

## Usage

```js
import { createActionMapper } from "@nebula/core-input";

const mapper = createActionMapper({
  bindings: {
    confirm: [
      { source: "gamepad", control: "a" },
      { source: "keyboard", control: "Enter" }
    ],
    back: [
      { source: "gamepad", control: "b" },
      { source: "keyboard", control: "Escape" }
    ]
  }
});

mapper.onAction((update) => {
  if (update.action === "confirm" && update.active) {
    console.log("Confirm action");
  }
});

mapper.mapEvent({
  source: "gamepad",
  control: "a",
  type: "pressed",
  value: 1
});
```

## SteamOS / Steam Deck notes
Pair this with a thin adapter that translates Steam Input or Gamepad API events into `InputEvent` objects. Keep bindings action-first so Deck, Xbox, and PlayStation controllers share the same behavior.
