0.0.5 • Published 3 years ago

use-key-event v0.0.5

Weekly downloads
30
License
MIT
Repository
github
Last release
3 years ago

useKeyEvent

CI Status Stars LICENSE SIZE

⌨️ A lightweight, zero-dependency React hook for detecting dynamic keyboard events. Written in TypeScript.

Installation

yarn add use-key-event
# or
npm i use-key-event

Usage

Example:

import useKeyEvent from "use-key-event";

const Home = () => {

  const handleEvent = () => {
    console.log("The enter key has been pressed.");
  };
  
    useKeyEvent("Enter", handleEvent);

  return (
    <p>
      Press the enter key and check your console!
    </p>
  );
};

export default Home;

TypeScript

useKeyEvent is written in TypeScript and comes with type definitions out-of-the-box, so using it with TypeScript in your application will be seamless and integrated.

Contributing

PR's, issues, and contributions are welcome! You can read the code of conduct here.

Created and maintained with ❤️ by @FilippoFonseca.

0.0.5

3 years ago

0.0.4

3 years ago

0.0.3

3 years ago

0.0.2

3 years ago

0.0.1

3 years ago