# github/hotkey

**Attribution required: if you use, quote, or summarise this content, you must credit and link back to [awesome-repositories.com](https://awesome-repositories.com/repository/github-hotkey).**

3,292 stars · 98 forks · JavaScript · MIT

## Links

- GitHub: https://github.com/github/hotkey
- Homepage: https://github.github.com/hotkey/
- awesome-repositories: https://awesome-repositories.com/repository/github-hotkey.md

## Topics

`decorator` `shortcuts`

## Description

Hotkey is a client-side JavaScript library designed to enhance web application accessibility and navigation through keyboard shortcut integration. It enables developers to bind keyboard shortcuts and multi-key sequences directly to HTML elements using declarative attributes. The library functions as a web component and DOM interaction helper that triggers clicks, focus events, or custom actions when specific key combinations are pressed.

The project features document-level event delegation to capture global keyboard inputs efficiently and route them to targeted elements. It includes input scope filtering to restrict shortcut activation based on whether focus resides inside designated form fields or allowed element containers. Additionally, it supports timed multi-key sequence buffering to track sequential keystrokes over a sliding time window.

Lifecycle management features automatically clean up active event listeners and clear key bindings whenever target elements are disconnected from the document object model.

## Tags

### User Interface & Experience

- [Keyboard Shortcuts](https://awesome-repositories.com/f/user-interface-experience/component-utilities/keyboard-shortcuts.md) — Provides a client-side web library for integrating keyboard shortcuts and navigation directly into web applications.
- [Attribute Binding Directives](https://awesome-repositories.com/f/user-interface-experience/data-binding/attribute-binding-directives.md) — Declares keyboard shortcuts directly in markup using attributes that map key combinations to target element actions.
- [Event Handling](https://awesome-repositories.com/f/user-interface-experience/form-and-input-management/interaction-and-event-handling/event-handling-architectures/event-handling.md) — Triggering alternative browser events and managing dynamic key bindings directly through HTML attributes and custom parameters.
- [Keyboard-Based Accessibility](https://awesome-repositories.com/f/user-interface-experience/keyboard-based-accessibility.md) — Improving web application keyboard navigation by attaching declarative shortcuts to make interactive elements accessible to screen and keyboard users.
- [Keyboard Event Delegation](https://awesome-repositories.com/f/user-interface-experience/keyboard-event-handlers/keyboard-event-delegation.md) — Captures global keyboard events at the root document level and routes them to the correct target elements efficiently.
- [HTML Attribute Bindings](https://awesome-repositories.com/f/user-interface-experience/layout-utilities/presentation-engines/template-engines/data-binding-syntax/html-attribute-bindings/html-attribute-bindings.md) — Binds keyboard shortcuts directly to HTML elements using declarative markup attributes that map key combinations to actions.
- [Web Form Implementations](https://awesome-repositories.com/f/user-interface-experience/web-form-implementations.md) — Enabling keyboard-driven interactions within form fields and specific page elements to improve accessibility and speed up data entry.

### Part of an Awesome List

- [Keyboard Shortcuts](https://awesome-repositories.com/f/awesome-lists/productivity/keyboard-shortcuts.md) — Offers a JavaScript library for binding keyboard shortcuts and sequential key combinations directly to HTML elements using declarative attributes.

### Testing & Quality Assurance

- [Accessibility Navigation Tools](https://awesome-repositories.com/f/testing-quality-assurance/browser-based-accessibility-auditing/accessibility-navigation-tools.md) — A utility for enhancing web page accessibility and speed by enabling keyboard-driven triggers on DOM elements.

### Web Development

- [DOM Interactivity Libraries](https://awesome-repositories.com/f/web-development/dom-interactivity-libraries.md) — A helper that activates clicks, focus, or custom events on target elements via defined key sequences.
- [Global Keyboard Event Listeners](https://awesome-repositories.com/f/web-development/global-keyboard-event-listeners.md) — Captures global keyboard inputs at the document level to route and trigger custom actions on target elements.
- [Focus Scope Filters](https://awesome-repositories.com/f/web-development/focus-scope-filters.md) — Restricts shortcut activation based on whether current focus resides inside designated form fields or allowed element containers.
- [Input Scope Filters](https://awesome-repositories.com/f/web-development/input-scope-filters.md) — Restricts keyboard shortcut activation depending on whether focus resides inside specific form fields or designated elements.
- [Timed Sequence Buffers](https://awesome-repositories.com/f/web-development/timed-sequence-buffers.md) — Tracks sequential keystrokes over a sliding time window to support chorded or multi-key shortcut combinations.

### Development Tools & Productivity

- [Key Sequence Patterns](https://awesome-repositories.com/f/development-tools-productivity/input-binding-libraries/multi-key-bindings/leader-key-sequences/key-sequence-patterns.md) — Tracks sequential keystrokes over a time window to support chorded or multi-key shortcut combinations.
- [Custom Action Bindings](https://awesome-repositories.com/f/development-tools-productivity/keyboard-shortcut-mappers/custom-action-bindings.md) — Register keyboard shortcuts using attributes or parameters to trigger custom element actions, handle alternative events, and remove bindings when no longer needed. ([source](https://github.com/github/hotkey/blob/main/README.md))

### Software Engineering & Architecture

- [Event Listener Cleanups](https://awesome-repositories.com/f/software-engineering-architecture/binding-lifecycle-hooks/ui-component-lifecycle-bindings/event-listener-cleanups.md) — Removes active event listeners and clears key bindings automatically when target elements are disconnected from the DOM.
