Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

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.

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"] }
]
}
}
}
}
}