
Security News
Axios Supply Chain Attack Reaches OpenAI macOS Signing Pipeline, Forces Certificate Rotation
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.
Easily manage keyboard interactions and complex hotkeys / keyboard shortcuts / shorthands
KeysMe is a tiny-tiny (note the double-tiny which makes it tiny * .5) library to handle keyboard interaction and super-complex hotkeys in a line.
...by design.
Exported as a ES module, can work with any JS project + has a beautiful React hook for even more enjoyment.
npm install --save keysme
As a pure function it can be used to perform simple checks against a KeyboardEvent-like object and a hotkey (string):
// checkHotkey(KeyboardEvent-like, hotkey);
// Example
import {checkHotkey} from "keysme";
myInput.addEventListener('keyup', e =>
// works in a focused input
checkHotkey(e, 'Shift-Ctrl-A') && doSomething()
);
body.addEventListener('keyup', e =>
// works on the entire page
checkHotkey(e, 'Meta-Space') && doSomething()
);
It can register and deregister global events for you (those that are listened on the body):
// registerHotkey(hotkey, f);
// deregisterHotkey(hotkey, f);
// deregisterHotkey(hotkey);
// Example
import {registerHotkey, deregisterHotkey} from "keysme";
registerHotkey('Shift-Ctrl-A', doSomething);
deregisterHotkey('Shift-Ctrl-A', doSomething);
deregisterHotkey('Shift-Ctrl-A');
As a hook it works easily with React functional components:
import {useHotkey} from 'keysme/react';
const Component = props => {
useHotkey('Shift-Ctrl-A', doSomething, dependencies);
return <div>I am amazing</div>
};
As a hook it will take care of registering and deregistering for you. Internally it will operate something like:
// ...
useEffect(() => {
registerHotkey(options.hotkey, option.f);
return () => {
deregisterHotkey(options.hotkey, options.f)
};
}, options.deps);
// ...
Please fork and contribute.
FAQs
Easily manage keyboard interactions and complex hotkeys / keyboard shortcuts / shorthands
We found that keysme demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

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.

Security News
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.

Security News
Open source is under attack because of how much value it creates. It has been the foundation of every major software innovation for the last three decades. This is not the time to walk away from it.

Security News
Socket CEO Feross Aboukhadijeh breaks down how North Korea hijacked Axios and what it means for the future of software supply chain security.