Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

bind-keyboard

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bind-keyboard

Lightweight Typescript library for managing keyboard event bindings and executing callback functions for specific key combinations

  • 0.0.11
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
12
increased by71.43%
Maintainers
1
Weekly downloads
 
Created
Source

bind-keyboard

npm npm downloads npm

GitLab (self-managed)

bind-keyboard is a lightweight Typescript library for managing keyboard event bindings and executing callback functions for specific key combinations. It's designed to simplify handling keyboard events in your web applications.

Features

  • Easily bind callback functions to specific key combinations.
  • Supports preventing repeated key press events when holding down a key.
  • Prevents intercepting key events when typing in input fields.
  • Debugging options for different levels of output.

Installation

You can install the "bind-keyboard" library via npm:

npm install bind-keyboard

Usage

To use "bind-keyboard," you need to create an instance of the BindKeyboard class. This instance can be used to add and manage keyboard event bindings. Here's a basic example:

import { BindKeyboard } from "bind-keyboard";

// Create a BindKeyboard instance
const bindKeyboard = new BindKeyboard();

// Add a key binding for ctrl+a
bindKeyboard.add("ctrl+a", (event) => {
  console.log("ctrl+a was pressed");
});

Examples

For more usage examples, please refer to the examples directory in the repository.

License

This project is licensed under the MIT License.

Keywords

FAQs

Package last updated on 14 Jan 2024

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc