0.3.0 • Published 8 months ago
@axuata/bindify v0.3.0
❓What is Bindify
Bindify is an intuitive key binding library.
📝Example
import {Keybinder} from '@axuata/bindify';
const keybinder = new Keybinder();
keybinder.createKeybind(['ControlLeft', 'KeyS'], () => {
console.log('Saved! (ControlLeft + KeyS)');
});🚀Installation
- Requires Node.js version >=18.0.0 (18.0.0 or above)
# npm
npm install @axuata/bindify
# yarn
yarn add @axuata/bindify
# pnpm
pnpm install @axuata/bindify⚙️Functions
createKeybind(keys: string[], callback: () => void)
=> Creates a keybind.
=> Keys valuesremoveKeybind(keys: string[])=> Removes a keybind.
⚠️Warning
- If you call
createKeybindmultiple times with the same key, runningremoveKeybindwill remove the first registered keybind, not the most recent one.- so, It's recommended not to register multiple keybinds with the same key.
📜Changelog
0.1.1
- Removed axuata-bindify-0.1.0.tgz
0.2.0
- Add: removeKeybind function
- Add: JSDoc
- Add: Test codes for new features
0.2.1
- Add: Keywords for npm
- Docs: Update README.md to warn users
- Docs: Update JSDoc comment
0.3.0
- Add: Use
event.code - Refactor: Removed unnecessary
ifstatement