Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/quisido/use-ctrl-key
React hook for listening to when the Ctrl key is pressed
https://github.com/quisido/use-ctrl-key
Last synced: 17 days ago
JSON representation
React hook for listening to when the Ctrl key is pressed
- Host: GitHub
- URL: https://github.com/quisido/use-ctrl-key
- Owner: quisido
- License: mit
- Created: 2020-10-16T05:30:36.000Z (about 4 years ago)
- Default Branch: master
- Last Pushed: 2021-04-27T21:06:48.000Z (over 3 years ago)
- Last Synced: 2024-10-01T09:13:32.702Z (about 1 month ago)
- Language: TypeScript
- Size: 41.4 MB
- Stars: 2
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# useCtrlKey [![Tweet](https://img.shields.io/twitter/url/http/shields.io.svg?style=social)](https://twitter.com/intent/tweet?text=Listen%20to%20Ctrl%20key%20events%20with%20React%20hooks&url=https://github.com/CharlesStover/use-ctrl-key&via=CharlesStover&hashtags=react,reactjs,javascript,typescript,webdev,webdevelopment) [![version](https://img.shields.io/npm/v/use-ctrl-key.svg)](https://www.npmjs.com/package/use-ctrl-key) [![minzipped size](https://img.shields.io/bundlephobia/minzip/use-ctrl-key.svg)](https://www.npmjs.com/package/use-ctrl-key) [![downloads](https://img.shields.io/npm/dt/use-ctrl-key.svg)](https://www.npmjs.com/package/use-ctrl-key) [![build](https://api.travis-ci.com/CharlesStover/use-ctrl-key.svg)](https://travis-ci.com/CharlesStover/use-ctrl-key/)
Listen to Ctrl key events with React hooks.
- [Install](#install)
- [Use](#use)
- [Sponsor](#sponsor)## Install
- `npm install use-ctrl-key` or
- `yarn add use-ctrl-key`## Use
```javascript
import useCtrlKey from 'use-ctrl-key';function App() {
const ctrlKey = useCtrlKey();
returnThe Ctrl key is {ctrlKey ? '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.