Mailspring/dot-nylas/keymap.cson
Ben Gotow a46bad4eb7 refactor(menus): Major prune of keymaps/commands, real conditional menus
Summary:
Keymaps & menus CSON => JSON, remove AtomKeymaps, CommandRegistry use of CSS selectors, use Mousetrap instead

Important Notes:

- The `application:` prefix is reserved for commands which are handled in the application process. Don't use it for other things. You will not receive the events in the window.

- Maintaining dynamic menus seems to come with quite an overhead, because Electron updates the entire menu every time. In the future, we'll need https://github.com/electron/electron/issues/528 to really make things nice. I will be tracking this upstream.

- The format for keyboard shortcuts has changed. `cmd-X` is now `command+shift+x`

Test Plan: Run tests

Reviewers: juan, evan

Reviewed By: evan

Differential Revision: https://phab.nylas.com/D2917
2016-04-24 12:16:25 -05:00

28 lines
823 B
Plaintext

# Your keymap
#
# N1 keymaps work in conjunction with the {KeyCommandsRegion} React
# component.
#
# A key, or sequence of keys is first mapped to a "command".
#
# The "command" is then mapped to a callback function within your React
# component or store.
#
# The keyboard -> command mapping is defined in this `.cson` file. Each
# mapping is scoped under the component that it applies to by matching the
# root-level CSS class of that component.
#
# Any global, top-level mappings are scoped under the `body` selector.
#
# For example:
#
# 'body':
# 'ctrl+c': 'application:new-message'
#
# '.my-custom-package':
# 'ctrl+p': 'myPackage:customAction'
#
# This file uses CoffeeScript Object Notation (CSON).
# If you are unfamiliar with CSON, you can read more about it here:
# https://github.com/bevry/cson#what-is-cson