artcraft/frontend/libs/components/keybinds
Brandon Thomas 0004726a36 ArtCraft Desktop (fresh start)
This is a fresh start for the `artcraft` repo.

The old monorepo, which included our web API gateway, job services, SRE
tools, various frontends, and more has moved to `artcraft-services`

You can find the full git history here:

https://github.com/storytold/artcraft-services

This change was motivated by the fact that the entire git history was
hundreds of gigabytes in size, which is unwieldy for anyone not in the
core team that doesn't care about support services outside of the core
artcraft app.

We wanted to keep this repo in its well-known place since we already
have users and activity here.

Please update your remotes to either `artcraft-services` or make a fresh
clone of this repo.

History can be found at the artcraft-services repo.
2026-09-11 14:19:51 -04:00
..
src ArtCraft Desktop (fresh start) 2026-09-11 14:19:51 -04:00
.babelrc ArtCraft Desktop (fresh start) 2026-09-11 14:19:51 -04:00
README.md ArtCraft Desktop (fresh start) 2026-09-11 14:19:51 -04:00
package.json ArtCraft Desktop (fresh start) 2026-09-11 14:19:51 -04:00
tsconfig.json ArtCraft Desktop (fresh start) 2026-09-11 14:19:51 -04:00
tsconfig.lib.json ArtCraft Desktop (fresh start) 2026-09-11 14:19:51 -04:00
tsconfig.spec.json ArtCraft Desktop (fresh start) 2026-09-11 14:19:51 -04:00
vite.config.ts ArtCraft Desktop (fresh start) 2026-09-11 14:19:51 -04:00

README.md

@storyteller/keybinds

Unified, customizable keyboard shortcuts for Artcraft. A single registry of remappable actions, switchable presets (Gamer / Blender-like), per-user overrides with conflict detection, and persistence — plus the UI primitives (<Kbd>, key-capture input) used by the Settings pane and the cheatsheet.

The video editor keeps its own separate keybind system and is intentionally not covered here (Settings links out to it).

Concepts

  • Action — a remappable operation (registry.ts), id-namespaced by surface (pagescene.transform.translate).
  • Binding — { code, ctrl?, shift?, alt? } keyed by physical event.code so WASD survives non-QWERTY layouts.
  • Preset — a named set of 3D binding deltas over the Gamer base (presets.ts). 2D/moodboard are preset-independent.
  • Store (keybinds-store.ts) — zustand + persist; resolves override → preset → base.

Usage

import { useResolvedKeybinds } from "@storyteller/keybinds";

const { matchAction, forAction, slotBindings } = useResolvedKeybinds();
// in a keydown handler:
const action = matchAction(e, "pagescene");
if (action === "pagescene.transform.translate") setGizmoMode("translate");

Engine modules that aren't React can read useKeybindsStore.getState().resolveBindings(id).