Skip to content

mini-eggs/keybinds

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Keybinds

What

Multi-key keybindings. Creates only two event listeners ever (keyup, keydown). Easily add Emacs-like (or other) keybindings to your JavaScript applications.

Why

I've made bad versions of this ~20 times. Time to put it on NPM.

How

$ npm i -s keybinds

and

import { listen, unlisten } from "keybinds";

let unlistenA = listen([], 65, () => {
  console.log("a");
});

listen([17], 65, () => {
  console.log("ctrl+a");
  unlistenA();
});

listen([17, 18], 65, () => {
  console.log("ctrl+alt+a");
  unlisten();
});

About

Create keyboard shortcuts for your applications.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published