1.0.7 • Published 4 years ago

@johnfanidis/usekeypress v1.0.7

Weekly downloads
-
License
MIT
Repository
gitlab
Last release
4 years ago

@johnfanidis/usekeypress

npm (scoped) npm bundle size (minified)

React keypress hook.

Install

$ npm install @johnfanidis/usekeypress

Usage

import useKeyPress from "@johnfanidis/usekeypress";

const MyComponent = () => {
    
    // Sets up the hook listening for the 'S' key
    const pressed_V_Key = useKeyPress(83, true);

    useEffect(() => {
        if (pressed_S_Key) {
            // do something when 'S' key is pressed
        }
    }, [pressed_S_Key]);
    
  return null;
}
1.0.7

4 years ago

1.0.6

4 years ago

1.0.5

4 years ago

1.0.4

4 years ago

1.0.3

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago