Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/substance/commander
A substantial keyboard event mapper based on Mousetrap and inspired by Sublime.
https://github.com/substance/commander
Last synced: about 2 months ago
JSON representation
A substantial keyboard event mapper based on Mousetrap and inspired by Sublime.
- Host: GitHub
- URL: https://github.com/substance/commander
- Owner: substance
- License: mit
- Created: 2013-07-16T08:18:29.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2015-07-15T14:50:07.000Z (over 9 years ago)
- Last Synced: 2024-04-15T12:47:29.456Z (9 months ago)
- Language: JavaScript
- Size: 345 KB
- Stars: 7
- Watchers: 11
- Forks: 2
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
Substance Commander
========**No longer maintained. Use http://github.com/substance/substance instead.**
A command mapper for `Substance.Views`.
- `Command.Keyboard` is a keyboard event mapper based on Mousetrap and inspired by Sublime.
## Command.Keyboard
Keyboard mappings are defined from an application commands' perspective.
Commands can be specified including arguments and are bound to keys or sequences of keys.
The key bindings are context sensitiv, i.e., only key bindings would be active that are bound
to a context that is in the hierarchy of a currently active view.{
// global key bindings
"commands": [
{"command": "quit", "keys": ["cmd-q"]},
{"command": "execute", "args": ["log", "Hello"], "keys": ["cmd-x"]}
],contexts: {
// bindings for view `app`
"app": {
"commands": [
{"command": "open-dashboard", "keys": ["cmd+d"], "args": ["my_documents"] }
],"contexts": {
"composer": {
"commands": [
{"command": "move-cursor", "keys": ["left"], "args": ["left"] }
]
}
}
}
}
}