Nerfing Powerful Megalomaniacs
    Have ideas to improve npm?Join in the discussion! »

    makeup-key-emitter

    0.1.3 • Public • Published

    makeup-key-emitter

    Emits custom events for common accessibility keys (arrowRightKeyDown, escKeyDown, etc).

    Experimental

    This CommonJS module is still in an experimental state, until it reaches v1.0.0 you must consider all minor releases as breaking changes. Patch releases may introduce new features, but will be backwards compatible.

    Install

    // via npm
    npm install makeup-key-emitter
     
    // via yarn
    yarn add makeup-key-emitter

    Example

    const KeyEmitter = require('makeup-key-emitter');
     
    let el = document.getElementById('#widget1');
     
    KeyEmitter.addKeyDown(el);
     
    el.addEventListener('arrowRightKeyDown', function(e) {
        console.log(this, e.type); // outputs (el1, 'arrowRightKeyDown')
    });

    Methods

    • addKeyDown(el)
    • addKeyUp(el)
    • removeKeyDown(el)
    • removeKeyUp(el)
    • add(el)
    • remove(el)

    Dependencies

    Install

    npm i makeup-key-emitter

    DownloadsWeekly Downloads

    30

    Version

    0.1.3

    License

    MIT

    Unpacked Size

    5.33 kB

    Total Files

    7

    Last publish

    Collaborators

    • avatar
    • avatar
    • avatar
    • avatar
    • avatar