useCtrlKey
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.