Implementation:0xranx OpenContext Keyboard Handlers
| Knowledge Sources | |
|---|---|
| Domains | Editor, React |
| Last Updated | 2026-10-24 00:00 GMT |
Overview
⚠ DEPRECATED: Keyboard event handlers for the legacy Plate editor, providing hotkeys for formatting, block insertion, list toggling, and navigation. Only imported by the dead PlateMarkdown component. See Heuristic:0xranx_OpenContext_Warning_Deprecated_Plate_Editor.
Description
The keyboardHandlers.js module in src/ui/src/editor/ exports a createEditorKeyDownHandler factory that returns a keydown event handler for the Plate editor. It handles keyboard shortcuts for bold, italic, strikethrough, code formatting, heading toggles (H1-H3), list toggles (bullet, numbered, task), and other editor-specific key bindings.
Usage
Import and attach the handler in PlateMarkdown.jsx via the editor's onKeyDown or DOM event listener.
Code Reference
Source Location
- Repository: 0xranx_OpenContext
- File: src/ui/src/editor/keyboardHandlers.js
- Lines: 1-482
Signature
export function createEditorKeyDownHandler(editor, options) // → (event) => void
Import
import { createEditorKeyDownHandler } from './editor/keyboardHandlers';
I/O Contract
Inputs
| Name | Type | Required | Description |
|---|---|---|---|
| editor | PlateEditor | Yes | Plate editor instance |
| options | object | No | Additional handler options |
Usage Examples
Attaching Keyboard Handler
import { createEditorKeyDownHandler } from './editor/keyboardHandlers';
const keyDownHandler = createEditorKeyDownHandler(editor);
// Attach to editor container
container.addEventListener('keydown', keyDownHandler);