Skip to content

quisido/use-ctrl-key

Repository files navigation

useCtrlKey Tweet version minzipped size downloads build

Listen to Ctrl key events with React hooks.

Install

  • npm install use-ctrl-key or
  • yarn add use-ctrl-key

Use

import useCtrlKey from 'use-ctrl-key';

function App() {
  const ctrlKey = useCtrlKey();
  return <p>The Ctrl key is {ctrlKey ? 'pressed' : 'not pressed'}.</p>;
}

Sponsor 💗

If you are a fan of this project, you may become a sponsor via GitHub's Sponsors Program.

About

React hook for listening to when the Ctrl key is pressed

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published