Keyboard Shortcuts System for OpenSearch Dashboards

Introduction

This RFC proposes introducing the keyboard shortcuts system provides a centralized, context-aware framework for managing keyboard shortcuts across OpenSearch Dashboards. It replaces fragmented, plugin-specific implementations with a unified service that handles conflict resolution, cross-platform compatibility, and user discoverability.

Problem Statement

OpenSearch Dashboards has scattered keyboard shortcut implementations across plugins:

Fragmented Implementation

  • Each plugin implements independent keyboard handling

  • Shared components lack coordinated shortcut behavior

  • No standardized registration API

Note: For now, text editor shortcuts (Monaco, etc.) are out of scope and remain editor-managed.

Poor User Experience

  • No help system to discover available shortcuts

  • Inconsistent behavior across plugins

  • Hidden functionality unknown to users

Technical Debt

  • Code duplication for common keyboard patterns

  • No deterministic conflict resolution in federated plugin environment

Architecture Overview

The keyboard shortcuts system is implemented as a core service in OpenSearch Dashboards, providing centralized management of keyboard shortcuts across all applications and plugins.

  • Single Global Event Listener - One keydown listener for the entire application

  • Context-Aware Help System - Shows relevant shortcuts based on current app context

  • Multi-Key Sequence Support - Handles complex shortcuts like “g+d” for navigation

  • Plugin Integration - Easy registration API for plugins and components

Solution: Console Warning for Conflict Detection

The solution adds conflict detection during shortcut registration without changing the core last-registered-wins behavior. When a duplicate key is detected, the system logs a detailed warning to help developers identify and resolve conflicts.

Current Keyboard Shortcut Constraints

Supported Keys (ALLOWED_KEYS)

The keyboard shortcut service currently supports a limited set of keys for security and consistency:

Letters: a-z (26 keys)
Numbers: 0-9 (10 keys)
Punctuation: , - = ; ’ . / \ ` (11 keys)
Arrow Keys: left up right down (4 keys)
Special Keys: tab enter escape space backspace delete (6 keys)

Total: 57 supported keys

Modifier Combinations (VALID_MODIFIER_COMBINATIONS)

Only specific modifier combinations are allowed, in canonical order:

  1. shift+

  2. alt+

  3. cmd+ (maps to Ctrl on Windows/Linux)

  4. alt+shift+

  5. cmd+shift+

  6. cmd+alt+

  7. cmd+alt+shift+

Note: ctrl+ is not directly supported - it’s normalized to cmd+ for cross-platform consistency.

Sequence Prefixes (SEQUENCE_PREFIX)

Currently supports vim-like two-key sequences with limited prefixes:

Supported Prefixes: g only

Example Sequences:

  • g d → Go to Discover

  • g v → Go to Visualizations

  • g b → Go to Dashboard

Unsupported Keys/Patterns

Function Keys: F1-F12 not supported
Numpad Keys: Numeric keypad keys not supported
Complex Sequences: Only 2-key sequences allowed (not g d d or g 1 2)

Potential for Future Expansion

User Customization

  • UI for customizing shortcuts - Settings page to change any keyboard shortcut with visual editor

  • Import/export functionality - Save/share shortcut configurations as JSON files for team standardization

hello @pohongl - I would recommend posting the RFC to the appropriate GitHub repo for Dashboards:

Here are a number of examples if that helps: