react-keyboard-manager
v1.0.5
Published
library for tracking keyboard button presses in React
Downloads
10
Maintainers
Readme
react-keyboard-manager
KeyboardProvider
Wrap the application in KeyboardProvider
Exapmle:
function App() {
return (
<KeyboardProvider>
<AppContent />
</KeyboardProvider>
);
}
useKeyboard
| prop | meaning | | -------- | --------------------------------------------- | | key | keyboard key value | | callback | function that is called when a key is pressed | | disabled | disable a callback call |
Exapmle:
useKeyboard({
key: "Escape",
callback: onCloseModal,
});