Lab

useTimelineCursor

What the keyboard does with an arrangement's cursor: the arrows on the grid, Home and End, Up and Down to pick a track, Alt and the arrows to jump between locators and clip edges, M to add a locator.

pnpm dlx shadcn@latest add @audio-ui/use-timeline-cursor
import { useTimelineCursor } from "@/hooks/use-timeline-cursor";
Fileshooks/use-timeline-cursor.ts
Depends onarrangement
npm@audio-ui/core, @audio-ui/react
Used byarrangement-editor, block-timeline
ExportKindWhat it is
UseTimelineCursorOptionsinterface
useTimelineCursorfunctionWhat the keyboard does with an arrangement's cursor.

Usage

useTimelineCursor is what the keys do with the cursor. handleKey takes M, which adds a locator, and Alt with the arrows, which jump to the next locator or clip edge, of the picked tracks or of every track. handleArrowKey takes the plain arrows, Home and End, for when a key reached the view rather than a control with arrows of its own: Left and Right move the cursor on the grid, Up and Down pick a track. Both say whether the key was theirs.

It is one of the parts the Arrangement composes.

API

Props · 4

Built by Ouest Labs, the source code is available on GitHub.
RSS