Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/quisido/use-shift-key

React hook for listening to shift key events
https://github.com/quisido/use-shift-key

Last synced: 17 days ago
JSON representation

React hook for listening to shift key events

Awesome Lists containing this project

README

        

# useShiftKey [![Tweet](https://img.shields.io/twitter/url/http/shields.io.svg?style=social)](https://twitter.com/intent/tweet?text=Listen%20to%20Shift%20key%20events%20with%20a%20React%20hook.&url=https://github.com/CharlesStover/use-shift-key&via=CharlesStover&hashtags=react,reactjs,javascript,typescript,webdev,webdevelopment) [![version](https://img.shields.io/npm/v/use-shift-key.svg)](https://www.npmjs.com/package/use-shift-key) [![minzipped size](https://img.shields.io/bundlephobia/minzip/use-shift-key.svg)](https://www.npmjs.com/package/use-shift-key) [![downloads](https://img.shields.io/npm/dt/use-shift-key.svg)](https://www.npmjs.com/package/use-shift-key) [![build](https://api.travis-ci.com/CharlesStover/use-shift-key.svg)](https://travis-ci.com/CharlesStover/use-shift-key/)

Listen to Shift key events with a React hook.

- [Install](#install)
- [Use](#use)
- [Sponsor](#sponsor)

## Install

- `npm install use-shift-key` or
- `yarn add use-shift-key`

## Use

```javascript
import useShiftKey from 'use-shift-key';

function App() {
const shiftKey = useShiftKey();
return

The Shift key is {shiftKey ? 'pressed' : 'not pressed'}.

;
}
```

## Sponsor 💗

If you are a fan of this project, you may
[become a sponsor](https://github.com/sponsors/CharlesStover)
via GitHub's Sponsors Program.