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