GitXplorerGitXplorer
y

shortcuts

public
53 stars
2 forks
1 issues

Commits

List of commits on branch master.
Unverified
faced8c11b904bd3afdace5eda3d7fab03227e44

Release 0.2.1

yyields committed 10 years ago
Unverified
4bc65f03b1ffd11378cf9fb200f3dabe0c618528

Merge pull request #3 from matthewmueller/patch-1

yyields committed 10 years ago
Unverified
73674ce46aacf7a9b73bbeb3d36f817b40dd0a16

update dep

mmatthewmueller committed 10 years ago
Unverified
4cec0112d64fedbc7a44d103191612ee2c3a909c

readme

yyields committed 11 years ago
Unverified
a63d0b2aeef2a8d0f9bc33ae969efca604454dff

Release 0.2.0

yyields committed 11 years ago
Unverified
bbbc18e2524e11fac2f774ac6f6eccea8beaf930

refactor

yyields committed 11 years ago

README

The README file for this repository.

shortcuts

keyboard shortcuts, similiar to component/events.

Installation

$ component install yields/shortcuts

Example

function Editable(el){
  this.shortcuts = shortcuts(el, this);
  this.shortcuts.bind('command + z', 'undo');
  this.shortcuts.bind('command + b', 'bold');
}

Editable.prototype.undo = function(e){};
Editable.prototype.bold = function(e){};

API

Shortcuts

Bind shortcuts on the given el with obj.

.k

k instance

#bind

Bind keys with method

#unbind

Unbind all events, or keys or keys with method.

shortcuts.unbind('command + z', 'undo') // => unbind `undo`, `command + z`
shortcuts.unbind('command + z'); // => unbind `command + z`
shortcuts.unbind(); // => unbind all

License

MIT