Giter VIP home page Giter VIP logo

kanye's Introduction

Kanye

Smash your keyboards with ease

Browser support includes every sane browser and IE7+.

Install

From npm

npm install kanye --save

From bower

bower install kanye --save

API

Kanye exposes a few methods for interacting with keyboard events.

kanye.on(combo, options?, listener)

Adds an event listener listener to the registry. This event listener will fire only when the user input is combo, and it can be optionally filtered by a filter selector.

The combo is expected to be a human-readable keyboard input string such as cmd+a or cmd+shift+b. If the conditions are satisfied, listener will be invoked passing the event as an argument. Options are outlined below and they can be omitted.

  • filter allows you to filter out the event target based on a selector or a DOM element
  • context allows you to group different shortcuts together, making them easier to remove on the future

kanye.off(combo, options?, listener)

Removes an event listener previously registered by kanye.on. You'll need to specify the options again to make sure that the event listener is correctly removed.

kanye.clear(context?)

Remove all event listeners previously added with .on to context. If a context is not provided, every single event listener ever registered with Kanye will be removed.

License

MIT

kanye's People

Contributors

bevacqua avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.