0.0.11 • Published 4 months ago

bind-keyboard v0.0.11

Weekly downloads
-
License
MIT
Repository
gitlab
Last release
4 months ago

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.

0.0.11

4 months ago

0.0.10

4 months ago

0.0.9

4 months ago

0.0.8

4 months ago

0.0.7

7 months ago

0.0.6

7 months ago

0.0.5

7 months ago

0.0.4

7 months ago

0.0.3

7 months ago

0.0.2

7 months ago

0.0.1

7 months ago