New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

react-hotkey-manager

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-hotkey-manager

TODO

0.1.2
latest
Source
npm
Version published
Weekly downloads
4
-42.86%
Maintainers
1
Weekly downloads
 
Created
Source

React Hotkey Manager

Global Hotkeys for React

NPM Version Build Status Downloads Stats

React Hotkey Manager is a Context Provider/Consumer that allows registering and unregistering global hotkeys by rendering (and later unmounting) a react component. e.g. if Component A contains Hotkeys, those hotkeys will be registered if and only if Component A is currently rendered.

Installation

npm install react-hotkey-manager

Usage

import { HotkeyManager, Hotkeys } from "react-hotkey-manager";

<SomewhereNearTheTopOfYourReactStack>
    <HotkeyManager>
        <StuffInTheMiddle>
            <Hotkeys
                keys={{
                    "esc": {
                        callback: () => console.log("ESC pressed in StuffInTheMiddle"),
                    },
                }}
            />
        </StuffInTheMiddle>
        <OtherStuff>
            <Hotkeys
                keys={{
                    "esc": {
                        callback: () => console.log("ESC pressed in OtherStuff"),
                    },
                    "ctrl+c": {
                        callback: () => console.log("ctrl+c pressed");
                    }
                }}
            />
        </OtherStuff>
    </HotkeyManager>
</SomewhereNearTheTopOfYourReactStack>

Development setup

npm install
npm test

Release History

  • 0.1.0
    • Initial public release

Meta

Kevan Davis kevan.davis@me.com

Distributed under the BSD license.

https://github.com/kmdavis/react-hotkey-manager

Contributing

Keywords

react

FAQs

Package last updated on 11 Mar 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts