Skip to content

feat(input): implement InputManager, pointer/keyboard dispatch, and focus management - #128

Merged
isrcalebe merged 1 commit into
developfrom
feat/122-input-manager-dispatch-focus
Nov 18, 2026
Merged

isrcalebe merged 1 commit into
developfrom
feat/122-input-manager-dispatch-focus

Conversation

@isrcalebe

Copy link
Copy Markdown
Contributor

Summary

  • Implement InputManager, PassThroughInputManager, and ManualInputManager in kajarlabs.Framework.Input, bridging platform/synthetic input events to Drawable trees with zero per-frame queue allocations and full NativeAOT compatibility (IsAotCompatible).
  • Implement front-to-back hover tracking (OnHover / OnHoverLost) with dynamic scene/layout re-evaluation, pointer capture and OnMouseDown/OnMouseUp/OnClick/OnDoubleClick (clock-based), drag threshold and lifecycle (OnDragStart / OnDrag / OnDragEnd), scroll bubbling, and focus management (ChangeFocus, TriggerFocusContention, automatic loss on removal/!IsPresent/disposal/WindowFocusLost, keyboard/text fallback, and GameWindow text-input lifecycle control).
  • Integrate a root InputManager into Game hosting Root (preserving Game.Root layout/disposal semantics) and caching it in the root DependencyCollection.
  • Add unit tests (InputManagerTests), HeadlessGameHost integration tests (HeadlessInputIntegrationTests), and NativeAOT smoke coverage in samples/aot-smoke.

Closes #122

Checklist

  • Labeled with one primary type label (feature, fix, docs, ci, chore, dependencies), plus breaking-change if applicable
  • Labeled with relevant area:* labels
  • Linked to an issue (Closes #122)
  • Public API changes are intentional (none, or listed below)
  • Tests added or updated
  • No new reflection or runtime code generation on the main path (NativeAOT-safe)

Public API changes

  • kajarlabs.Framework.Input.InputManager:
    • CurrentState, FocusedDrawable, HoveredDrawables, DragDistanceThreshold, DoubleClickTimeThreshold, DoubleClickDistanceThreshold, UseParentInput
    • ChangeFocus(Drawable?), TriggerFocusContention(Drawable?)
  • kajarlabs.Framework.Input.PassThroughInputManager:
    • UseParentInput (get/set, defaults to true)
  • kajarlabs.Framework.Input.ManualInputManager:
    • MoveMouseTo, PressButton, ReleaseButton, Click, Scroll, MouseLeave, PressKey, ReleaseKey, InputText, SetWindowFocus
  • kajarlabs.Framework.Game:
    • InputManager property

@isrcalebe isrcalebe added feature New functionality area:scene Drawables, containers, layout area:input Input handling and propagation labels Nov 18, 2026
@isrcalebe
isrcalebe merged commit 22c4b91 into develop Nov 18, 2026
3 of 5 checks passed
@isrcalebe
isrcalebe deleted the feat/122-input-manager-dispatch-focus branch November 18, 2026 19:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:input Input handling and propagation area:scene Drawables, containers, layout feature New functionality

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Input: InputManager, hover/click/drag/scroll dispatch, and focus management

1 participant