yuvrajkarna2717/react-hook-granth

[Feature]: Add useKeyboard hook for keyboard shortcuts

开放

#10 创建于 2025年12月6日

 (0 条评论) (0 个反应) (0 位负责人)JavaScript (1 个派生)auto 404
enhancementgood first issuehelp wanted

仓库指标

星标
 (3 个星标)
PR 合并指标
 (PR 指标待抓取)

描述

Hook Name

useKeyboard

Feature Description

Description: Create a hook for handling keyboard shortcuts and key combinations in React components.

Requirements:

  • Single key and key combinations
  • Modifier keys support (Ctrl, Alt, Shift)
  • Prevent default behavior option
  • Multiple shortcuts per component

Use Case

It handles keyboard shortcuts and key combinations in React components.

Proposed API

useKeyboard('Escape', handleEscape);
useKeyboard(['Ctrl', 'S'], handleSave);

贡献者指南