0.1.7 • Published 3 years ago

react-hooks-keydow v0.1.7

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

react-hooks-keydow

React js library that contains a KeyDown event listener which will execute a function whenever the key pressed by the user matches some keys of the array you provide.

Install

You can use yarn or npm.

Yarn

yarn add react-hooks-keydow

npm

npm i react-hooks-keydow

Usage

  • Simply import react-hooks-keydow
import { useKeyDownEvent, Comands } from 'react-hooks-keydow';

const App = () => {
  const callback = key => {
    console.log(key);
  };

  useKeyDownEvent({
    callback,
    comand: Comands.ctrlKey,
    keys: ['a', 'b', 'Escape'],
  });
};

export default App;
0.1.7

3 years ago

0.1.6

3 years ago

0.1.5

3 years ago

0.1.4

3 years ago

0.1.3

3 years ago

0.1.2

3 years ago

0.1.1

3 years ago

0.1.0

3 years ago