useShiftKey
Listen to Shift key events with a React hook.
Install
-
npm install use-shift-key
or yarn add use-shift-key
Use
import useShiftKey from 'use-shift-key';
function App() {
const shiftKey = useShiftKey();
return <p>The Shift key is {shiftKey ? 'pressed' : 'not pressed'}.</p>;
}
💗
Sponsor If you are a fan of this project, you may become a sponsor via GitHub's Sponsors Program.