Docs/Keyboard API
Universal Developer

Keyboard API

Keyboard API

Current Contract

Plugin UI keyboard handling is local to the plugin renderer. Use DOM/component keyboard events, or host-provided props such as hostKeyEvent when a host component passes them.

feature.onKeyEvent(), onCoreBoxKeyEvent(), and the raw core-box:key-event channel are retired. The channel had no production sender, so it is not a supported extension surface.

ESC Behavior

ESC is still handled by CoreBox. When a plugin UI view is attached, pressing ESC exits UI mode automatically; plugins do not need to subscribe to a keyboard channel for this.

EXAMPLE.TYPESCRIPT
// Handled by CoreBox host code, not by plugin SDK.
uiView.webContents.on('before-input-event', (event, input) => {
  if (input.key === 'Escape' && input.type === 'keyDown') {
    coreBoxManager.exitUIMode()
    event.preventDefault()
  }
})

Supported Channels

ChannelDirectionStatus
core-box:forward-key-eventRenderer -> MainInternal CoreBox renderer transport
core-box:get-ui-view-stateRenderer -> MainInternal CoreBox renderer transport

Migration

Replace feature.onKeyEvent() and raw core-box:key-event listeners with local keyboard handlers inside the plugin UI component. For attached widgets, prefer the host-provided hostKeyEvent prop when available.