Skip to content

feat: data-oriented input sources - #118

Merged
kvvasuu merged 26 commits into
mainfrom
feat/input-dod
Oct 7, 2026
Merged

kvvasuu merged 26 commits into
mainfrom
feat/input-dod

Conversation

@kvvasuu

@kvvasuu kvvasuu commented Oct 7, 2026 •

Copy link
Copy Markdown
Collaborator

Reworks input into small per-frame data sources, so cameras can be driven by the mouse, touch, wheel and pinch, or by any data.

Changes

  • InputAxis.setValue jumps to a value without easing.
  • VirtualCamera.inputAxes collects the axes of all its pieces. <InputController> placed directly in <VirtualCamera> uses them.
  • Mappings are optional per source, and the new single-axis mappings are wheel and pinch.
  • Mouse, touch, wheel and Safari gesture input now come from internal sources in src/input-sources/. Lint keeps that folder free of klipp imports. InputSystem is a thin layer over them.
  • New docs page "Input from data" and an "Input" examples category.

Fixes

  • frameloop="demand" wakes on every input event, including the wheel.
  • Line- and page-based wheel deltas are converted to pixels.
  • The canvas gets its inline touch-action / user-select back after disconnecting.
  • Held buttons and fingers are released on blur and lost pointer capture.
  • iOS touch pinches are no longer counted twice.
  • The page keeps its scrolling and pinch zoom unless wheel / trackpadPinch is mapped.

Breaking

  • InputAxisController → InputControllerDom, lastInput → input.
  • Config types (InputControllerConfig, InputSourceMapping, …) are exported from @kvvasuu/klipp, no longer from /dom.
  • ConsumedInput.gestureZoomDelta is now the change in ln(scale).
  • ConsumedInput.touchPinchDelta, gestureZoomDelta and wheelZoomDelta are replaced by one pinchDelta, the change in ln(scale) from fingers or a trackpad.

Benches

Input benches are rewritten around a fake DOM. All benches warm up before yield, since labs otherwise decides on batching from cold first calls and reports inflated times.

kvvasuu added 26 commits October 7, 2026 18:14
@kvvasuu
kvvasuu merged commit 79cd0e3 into main Oct 7, 2026
1 check passed
@kvvasuu
kvvasuu deleted the feat/input-dod branch October 7, 2026 21:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant