Tiny Key Binding JavaScript Library – Tinykeys.js

Views Total:0 views
Official Page:Go to website
Last Update:July 31, 2020


Tiny Key Binding JavaScript Library – Tinykeys.js


A super tiny (~0.4kb) JavaScript library for handling key bindings on the web app.

How to use it:

1. Install & download.

$ npm i tinykeys --save

2. Import the Tinykeys.js.

# ES Module
import tinykeys from "tinykeys"

# Browser
<script src=""></script>

3. Add keyboard shortcuts for actions in your web app.

tinykeys(window, {
  "Shift+D": () => {
    alert("The 'Shift' and 'd' keys were pressed at the same time")
  "y e e t": () => {
    alert("The keys 'y', 'e', 'e', and 't' were pressed in order")
  "$mod+KeyD": () => {
    alert("Either 'Control+d' or 'Meta+d' were pressed")

Source link

Add comment


All visitors can share my site’s content on their blogs, sites, and social networks to enrich the content

Only share the source

Follow us

Don't be shy, get in touch. We love meeting interesting people and making new friends.