Skip to content

Simple React hook for handling KeyboardEvents with special keys

Notifications You must be signed in to change notification settings

Writhe/use-special-keys

Repository files navigation

useSpecialKeys

Installation

npm -i use-special-keys

or

yarn add use-special-keys

Usage

import { useSpecialKeys } from 'use-special-keys';

const handleKeyDown = useSpecialKeys<HTMLInputElement>({
  Enter: event => console.log(event.currentTarget.value),
  Escape: event => console.log(event.currentTarget.value),
});

About

Simple React hook for handling KeyboardEvents with special keys

Resources

Stars

Watchers

Forks

Packages

No packages published