Skip to content

Add keyboard action support on macOS #1158

Closed

Description

@Kyle-Ye

Summary

Key presses on macOS do not trigger actions in OpenSwiftUI views. Add the path from AppKit key events to focus and key press actions.

Scope

  • Convert AppKit key events and send them to the focused view.
  • Build the focusable view graph and support focus navigation.
  • Connect focus between NSHostingView and the AppKit responder chain.
  • Support the onKeyPress down, repeat, and up phases, and Space and Return activation of the focused control.
  • Add a macOS example.

Acceptance criteria

  • In an NSHostingView, onKeyPress handlers receive down, repeat, and up events.
  • Space or Return triggers the action of the focused control.

API reference

Activity

  1. added this to the 0.24.0 milestone on Oct 16, 2026
  2. added
    platform: macOS
    type: feature
    area: event-gesture
    on Oct 16, 2026
  3. added
    area: hosting-bridge
    on Oct 16, 2026
  4. modified the milestones: 0.24.0, 0.25.0 on Oct 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: event-gesturearea: hosting-bridgeplatform: macOStype: feature

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions