Skip to content

Up05/BindsJS

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 

Repository files navigation

BindsJS

A keyboard shortcut library for javascript.


Guide

Using the library

You can download the library from releases (middle right).
Put it in your your projects folder and link it in your index.html file.

<script src="path/to/binds.js"></script>

Creating binds

myBind1 = new BindElt(myButtonElement); 
myBind2 = new BindFxn(myFunctionPointer);

Giving your binds keys & key combinations

myBind1.addKeyBind("a");
myBind2.addKeyCombination(Keys.Ctrl, "b");

Customizing your binds

myBind1.ignoreInputs(false);
myBind1.setName("name");
myBind2.preventDefault(true);

Chaining bind functions

new BindFxn(function(){ console.log("Yea!") })
  .setKeyBind("d")
  .setName("Yeah!")
  .setDescription("d for Yea!")
  .preventDefault(true)

TODO

  • Make a website for this thingy. Nevermind, i forgot a website needed css, I can make a cli for this i guess, but github is GOOD ENOUGH!