Socket
Socket
Sign inDemoInstall

bind-keyboard

Package Overview
Dependencies
0
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

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


Version published
Weekly downloads
0
decreased by-100%
Maintainers
1
Created
Weekly downloads
 

Readme

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

Last updated on 14 Jan 2024

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc