
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
🔥 Litkey makes keyboard shortcuts simple and enjoyable.
# Using npm
npm install litkey
# Using yarn
yarn add litkey
import litkey from 'litkey';
// Add a global keyboard shortcut
litkey('mod+k', () => {
// do something
});
// Add a keyboard shortcut to a specific element
litkey('mod+k', () => {
// do something
}, myElement);
import { useShortcut } from 'litkey';
let Component = () => {
let [clicked, setClicked] = useState(false);
useShortcut('mod+a', () => {
setClicked(true);
});
// You can also specify hook dependencies which will
// get passed on to the underlying useEffect
useShortcut('mod+k', () => {
setClicked(true);
}, [/* react hook dependency list */]);
// Using the fourth parameter, you can specify a
// specific DOM element, in which the keyboard
// shortcut will be fired
useShortcut('mod+k', () => {
setClicked(true);
}, [], myElement);
return (
<p>{ clicked ? 'clicked' : 'not clicked' }</p>
);
};
litkey(shortcut, handler, [context])The litkey function is the default export of litkey.
shortcut: string | string[]shortcut is a string or an array of strings, which specify the key combinations which will fire the callback.
handler: (event: KeyboardEvent) => anyThe handler is a callback function which will be called if the keyboard shortcut is pressed.
It receives the KeyboardEvent as its first parameter.
context?: HTMLElementThe context is optional and can be used to specify the HTMLElement, in which litkey will listen for keyboard shortcuts.
useShortcut(shortcut, handler, [dependencies, [context]])shortcut: string | string[]shortcut is a string or an array of strings, which specify the key combinations which will fire the callback.
handler: (event: KeyboardEvent) => anyThe handler is a callback function which will be called if the keyboard shortcut is pressed.
It receives the KeyboardEvent as its first parameter.
dependencies: any[]dependencies is an optional array, which will be passed on directly to useEffect to serve as React hook dependencies.
context?: HTMLElementcontext is optional and can be used to specify the HTMLElement, in which litkey will listen for keyboard shortcuts.
MIT © Tobias Herber
FAQs
Enjoyable keyboard shortcuts
We found that litkey 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
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.