@nk11/keyboard-interactions
v1.0.8
Published
A wrapper for mousetrap and other human interface libraries with additional actions to be able to change hotkeys for actions via dialog.
Downloads
4
Readme
| | | :---: | | keyboard-interactions | | Wrapper around keyboard inputs | | [][license-url] | | | | |
Project Overview
This library contains a simple wrapper for different input methods. By introducing an 'action' to bind multiple input combos plus their handlers with it a better customisation by the user may be achieved.
For example:
function hello()
{ console.log("hello world") }
//bind the action to ctrl+space as default trigger
Hotkeys("hello-action", "ctrl+space", hello)
For the time being this is not meant to be a stand alone library But rather as a backend for a compatible GUI. For the reference implementation dowload npm "@nk/core-components" and check out the "nk-hotkey-dialog" example
Features
- Better Usability by customizing Keyboard Inputs
credits, references, acknowledgements
- Mousetrap.js - ccampbell/mousetrap
- Keypress.js - dmauro/Keypress
technical goals
- function as a no-gui backend for UI components that implement a keymap dialog
possible extensions
- interface for other HID
- gyro+ accelerometer - https://github.com/dorukeker/gyronorm.js/
- mouse and touch - http://hammerjs.github.io/recognizer-pinch/
- though the library is primarily targeted to solve they keymap via actions, we should expose the same functionality without the actions
(this is useful where no configuration will be necessary ike with the gyro maybe)
[license-url]: