Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
B

backbone-shortcuts

> 编程语言
Open source

Backbone.js + Keymaster.js = Backbone.Shortcuts (Keyboard shortcuts)

100 stars0 likes2 views
WebsiteGitHub

About

Backbone.js + Keymaster.js = Backbone.Shortcuts (Keyboard shortcuts)

Backbone.Shortcuts

Backbone.js + Keymaster.js = Backbone.Shortcuts.

Downloads

  • Development Version 1.031 kb, full source code
  • Production Version 0.577 kb, packed and gzipped

Dependencies

  • Underscore.js ~> 1.3.1 for _.extend() function
  • Backbone.js ~> 0.9.1 for Backbone class
  • Keymaster.js ~> 1.0.2 for keyboard shortcuts functionality

Usage

HTML

Place snippets inside of the ... tags.

xml

JavaScript

javascript
var ShortcutKeys = Backbone.Shortcuts.extend({
  shortcuts: {
    "ctrl+r" : "reloadPage"
  },
  reloadPage: function() {
    alert("Reloaded!!");
  }
});

var shortcuts = new ShortcutKeys;

CoffeeScript

coffeescript
class ShortcutKeys extends Backbone.Shortcuts
  shortcuts:
    "ctrl+r" : "reloadPage"
  reloadPage: -> alert "Reload!!!"

shortcuts = new ShortcutKeys

Finally, you can press Ctrl + r to execute reloadPage() function to see the alert message.

Use Backbone.Shortcuts as Delegation for your Backbone.View

You have to _.extend the this as desination and new Backbone.Shortcuts as source then finally call the delegate function this.delegateShortcuts();.

See My jsFiddle Example

Author

Bryan Goines, @bryangoines

License

Backbone.Shortcuts is licensed under MIT license.

Issues· 9 open

View all issuesOpen on GitHub

No open issues yet, or sync has not completed.

> Tags

JavaScript

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 18, 2026
Category编程语言
PricingOpen source

> Related tools

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言