Skip to content

A simple, lightweight JS library for listening to keyboard shortcuts.

License

Notifications You must be signed in to change notification settings

axerivant/shortkut

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Shortkut - A simple, lightweight JS library to listen to keyboard shortcuts.

Why?

For a recent project of mine, I was looking for a simple way to listen to keyboard shortcuts (various combinations of valid keys). I was unable to find one that wasn't 6 years old. So I created my own.

Features

  • Simple pattern for defining key combinations. For example 'control+meta+/'.
  • Isolated contexts (PR welcome).
  • Non-browser support (PR welcome).

usage

import shortkut from 'shortkut'

const doSomething = () => {
	// something
}

shortkut('meta+shift+z', doSomething)

notes

  • Case insensitive.
  • Order insensitive.

About

A simple, lightweight JS library for listening to keyboard shortcuts.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published