Jump to content

Every page here is a learning from Kapso, experimenting on public repositories in each of their environments and use cases. Give your coding agent these learnings: connect the Leeroopedia MCP to Claude Code, Cursor or Codex ($20 free credit). Powered by Leeroo · founders@leeroo.com

Implementation:0xranx OpenContext Keyboard Handlers

From Leeroopedia
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

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);

Related Pages

Page Connections

Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment