mirror of
https://github.com/atom/atom.git
synced 2026-04-28 03:01:47 -04:00
Merge pull request #1066 from atom/cj-sublime-bindings
Sublime key binding pairity
This commit is contained in:
@@ -1,29 +0,0 @@
|
||||
'body':
|
||||
'meta-up': 'core:move-to-top'
|
||||
'meta-down': 'core:move-to-bottom'
|
||||
'meta-shift-up': 'core:select-to-top'
|
||||
'meta-shift-down': 'core:select-to-bottom'
|
||||
|
||||
'.editor':
|
||||
'meta-left': 'editor:move-to-first-character-of-line'
|
||||
'meta-right': 'editor:move-to-end-of-line'
|
||||
'meta-shift-left': 'editor:select-to-first-character-of-line'
|
||||
'meta-shift-right': 'editor:select-to-end-of-line'
|
||||
|
||||
'home': 'editor:move-to-first-character-of-line'
|
||||
'end': 'editor:move-to-end-of-line'
|
||||
'shift-home': 'editor:select-to-first-character-of-line'
|
||||
'shift-end': 'editor:select-to-end-of-line'
|
||||
|
||||
'alt-left': 'editor:move-to-previous-word-boundary'
|
||||
'alt-right': 'editor:move-to-next-word-boundary'
|
||||
'alt-shift-left': 'editor:select-to-previous-word-boundary'
|
||||
'alt-shift-right': 'editor:select-to-next-word-boundary'
|
||||
|
||||
'alt-backspace': 'editor:backspace-to-beginning-of-word'
|
||||
'meta-backspace': 'editor:backspace-to-beginning-of-line'
|
||||
|
||||
'alt-delete': 'editor:delete-to-end-of-word'
|
||||
'ctrl-t': 'editor:transpose'
|
||||
'ctrl-A': 'editor:select-to-first-character-of-line'
|
||||
'ctrl-E': 'editor:select-to-end-of-line'
|
||||
@@ -1,97 +0,0 @@
|
||||
'body':
|
||||
'meta-q': 'application:quit'
|
||||
'meta-h': 'application:hide'
|
||||
'meta-H': 'application:hide-other-applications'
|
||||
'meta-n': 'application:new-file'
|
||||
'meta-N': 'application:new-window'
|
||||
'meta-o': 'application:open'
|
||||
'meta-O': 'application:open-dev'
|
||||
'meta-m': 'application:minimize'
|
||||
'meta-,': 'application:show-settings'
|
||||
'alt-meta-ctrl-m': 'application:zoom'
|
||||
'meta-alt-ctrl-s': 'application:run-all-specs'
|
||||
|
||||
'meta-s': 'core:save'
|
||||
'meta-S': 'core:save-as'
|
||||
'enter': 'core:confirm'
|
||||
'escape': 'core:cancel'
|
||||
'meta-w': 'core:close'
|
||||
'up': 'core:move-up'
|
||||
'down': 'core:move-down'
|
||||
'left': 'core:move-left'
|
||||
'right': 'core:move-right'
|
||||
'shift-up': 'core:select-up'
|
||||
'shift-down': 'core:select-down'
|
||||
'shift-left': 'core:select-left'
|
||||
'shift-right': 'core:select-right'
|
||||
'meta-a': 'core:select-all'
|
||||
'backspace': 'core:backspace'
|
||||
'shift-backspace': 'core:backspace'
|
||||
'delete': 'core:delete'
|
||||
'meta-z': 'core:undo'
|
||||
'meta-Z': 'core:redo'
|
||||
'meta-y': 'core:redo'
|
||||
'meta-x': 'core:cut'
|
||||
'meta-c': 'core:copy'
|
||||
'meta-v': 'core:paste'
|
||||
'pageup': 'core:page-up'
|
||||
'pagedown': 'core:page-down'
|
||||
|
||||
'meta-alt-s': 'window:save-all'
|
||||
'meta-W': 'window:close'
|
||||
'meta-+': 'window:increase-font-size'
|
||||
'meta--': 'window:decrease-font-size'
|
||||
'ctrl-w w': 'window:focus-next-pane'
|
||||
'ctrl-tab': 'window:focus-next-pane'
|
||||
'ctrl-meta-f': 'window:toggle-full-screen'
|
||||
'ctrl-alt-meta-r': 'window:reload'
|
||||
'alt-meta-i': 'window:toggle-dev-tools'
|
||||
'meta-alt-ctrl-p': 'window:run-package-specs'
|
||||
|
||||
'ctrl-|': 'pane:split-right'
|
||||
'ctrl-w v': 'pane:split-right'
|
||||
'ctrl--': 'pane:split-down'
|
||||
'ctrl-w s': 'pane:split-down'
|
||||
|
||||
'meta-{': 'pane:show-previous-item'
|
||||
'meta-}': 'pane:show-next-item'
|
||||
'alt-meta-left': 'pane:show-previous-item'
|
||||
'alt-meta-right': 'pane:show-next-item'
|
||||
'meta-1': 'pane:show-item-1'
|
||||
'meta-2': 'pane:show-item-2'
|
||||
'meta-3': 'pane:show-item-3'
|
||||
'meta-4': 'pane:show-item-4'
|
||||
'meta-5': 'pane:show-item-5'
|
||||
'meta-6': 'pane:show-item-6'
|
||||
'meta-7': 'pane:show-item-7'
|
||||
'meta-8': 'pane:show-item-8'
|
||||
'meta-9': 'pane:show-item-9'
|
||||
'meta-T': 'pane:reopen-closed-item'
|
||||
'alt-meta-w': 'pane:close-other-items'
|
||||
'meta-P': 'pane:close'
|
||||
|
||||
'.tool-panel':
|
||||
'meta-escape': 'tool-panel:unfocus'
|
||||
'escape': 'core:close'
|
||||
'meta-w': 'noop'
|
||||
|
||||
# allow standard input fields to work correctly
|
||||
'input:not(.hidden-input)':
|
||||
'tab': 'core:focus-next'
|
||||
'shift-tab': 'core:focus-previous'
|
||||
'left': 'native!'
|
||||
'right': 'native!'
|
||||
'shift-left': 'native!'
|
||||
'shift-right': 'native!'
|
||||
'backspace': 'native!'
|
||||
'shift-backspace': 'native!'
|
||||
'delete': 'native!'
|
||||
'meta-z': 'native!'
|
||||
'meta-Z': 'native!'
|
||||
'meta-x': 'native!'
|
||||
'meta-c': 'native!'
|
||||
'meta-v': 'native!'
|
||||
|
||||
'button':
|
||||
'tab': 'core:focus-next'
|
||||
'shift-tab': 'core:focus-previous'
|
||||
194
keymaps/default.cson
Normal file
194
keymaps/default.cson
Normal file
@@ -0,0 +1,194 @@
|
||||
'body':
|
||||
# Apple specific
|
||||
'meta-q': 'application:quit'
|
||||
'meta-h': 'application:hide'
|
||||
'meta-H': 'application:hide-other-applications'
|
||||
'meta-m': 'application:minimize'
|
||||
'alt-meta-ctrl-m': 'application:zoom'
|
||||
|
||||
'ctrl-p': 'core:move-up'
|
||||
'ctrl-n': 'core:move-down'
|
||||
'ctrl-b': 'core:move-left'
|
||||
'ctrl-f': 'core:move-right'
|
||||
'ctrl-P': 'core:select-up'
|
||||
'ctrl-N': 'core:select-down'
|
||||
'ctrl-F': 'core:select-right'
|
||||
'ctrl-B': 'core:select-left'
|
||||
'ctrl-h': 'core:backspace'
|
||||
'ctrl-d': 'core:delete'
|
||||
|
||||
# Atom Specific
|
||||
'meta-O': 'application:open-dev'
|
||||
'meta-alt-ctrl-s': 'application:run-all-specs'
|
||||
'enter': 'core:confirm'
|
||||
'escape': 'core:cancel'
|
||||
'up': 'core:move-up'
|
||||
'down': 'core:move-down'
|
||||
'left': 'core:move-left'
|
||||
'right': 'core:move-right'
|
||||
'ctrl-alt-meta-r': 'window:reload'
|
||||
'alt-meta-i': 'window:toggle-dev-tools'
|
||||
'meta-alt-ctrl-p': 'window:run-package-specs'
|
||||
|
||||
# Sublime Parity
|
||||
'meta-,': 'application:show-settings'
|
||||
'meta-N': 'application:new-window'
|
||||
'meta-W': 'window:close'
|
||||
'meta-o': 'application:open'
|
||||
'meta-T': 'pane:reopen-closed-item'
|
||||
'meta-n': 'application:new-file'
|
||||
'meta-s': 'core:save'
|
||||
'meta-S': 'core:save-as'
|
||||
'meta-alt-s': 'window:save-all'
|
||||
'meta-w': 'core:close'
|
||||
'meta-ctrl-f': 'window:toggle-full-screen'
|
||||
'meta-z': 'core:undo'
|
||||
'meta-Z': 'corey:redo'
|
||||
'meta-y': 'corey:redo'
|
||||
'meta-x': 'core:cut'
|
||||
'meta-c': 'core:copy'
|
||||
'meta-v': 'core:paste'
|
||||
'shift-up': 'core:select-up'
|
||||
'shift-down': 'core:select-down'
|
||||
'shift-left': 'core:select-left'
|
||||
'shift-right': 'core:select-right'
|
||||
'delete': 'core:delete'
|
||||
'pageup': 'core:page-up'
|
||||
'pagedown': 'core:page-down'
|
||||
'backspace': 'core:backspace'
|
||||
'shift-backspace': 'core:backspace'
|
||||
'meta-up': 'core:move-to-top'
|
||||
'meta-down': 'core:move-to-bottom'
|
||||
'meta-shift-up': 'core:select-to-top'
|
||||
'meta-shift-down': 'core:select-to-bottom'
|
||||
'meta-{': 'pane:show-previous-item'
|
||||
'meta-}': 'pane:show-next-item'
|
||||
'meta-alt-left': 'pane:show-previous-item'
|
||||
'meta-alt-right': 'pane:show-next-item'
|
||||
'meta-=': 'window:increase-font-size'
|
||||
'meta-+': 'window:increase-font-size'
|
||||
'meta--': 'window:decrease-font-size'
|
||||
|
||||
'meta-k up': 'pane:split-up' # Atom Specific
|
||||
'meta-k down': 'pane:split-down' # Atom Specific
|
||||
'meta-k left': 'pane:split-left' # Atom Specific
|
||||
'meta-k right': 'pane:split-right' # Atom Specific
|
||||
'meta-k meta-w': 'pane:close' # Atom Specific
|
||||
'meta-k alt-meta-w': 'pane:close-other-items' # Atom Specific
|
||||
'meta-k meta-left': 'window:focus-previous-pane'
|
||||
'meta-k meta-right': 'window:focus-next-pane'
|
||||
'meta-1': 'pane:show-item-1'
|
||||
'meta-2': 'pane:show-item-2'
|
||||
'meta-3': 'pane:show-item-3'
|
||||
'meta-4': 'pane:show-item-4'
|
||||
'meta-5': 'pane:show-item-5'
|
||||
'meta-6': 'pane:show-item-6'
|
||||
'meta-7': 'pane:show-item-7'
|
||||
'meta-8': 'pane:show-item-8'
|
||||
'meta-9': 'pane:show-item-9'
|
||||
|
||||
'.editor':
|
||||
# Apple Specific
|
||||
'alt-left': 'editor:move-to-previous-word-boundary'
|
||||
'alt-right': 'editor:move-to-next-word-boundary'
|
||||
'alt-shift-left': 'editor:select-to-previous-word-boundary'
|
||||
'alt-shift-right': 'editor:select-to-next-word-boundary'
|
||||
'meta-backspace': 'editor:backspace-to-beginning-of-line'
|
||||
'meta-delete': 'editor:backspace-to-beginning-of-line'
|
||||
'ctrl-A': 'editor:select-to-first-character-of-line'
|
||||
'ctrl-E': 'editor:select-to-end-of-line'
|
||||
'meta-left': 'editor:move-to-first-character-of-line'
|
||||
'meta-right': 'editor:move-to-end-of-line'
|
||||
'meta-shift-left': 'editor:select-to-first-character-of-line'
|
||||
'meta-shift-right': 'editor:select-to-end-of-line'
|
||||
'home': 'editor:move-to-first-character-of-line'
|
||||
'end': 'editor:move-to-end-of-line'
|
||||
'shift-home': 'editor:select-to-first-character-of-line'
|
||||
'shift-end': 'editor:select-to-end-of-line'
|
||||
'alt-backspace': 'editor:backspace-to-beginning-of-word'
|
||||
'alt-delete': 'editor:delete-to-end-of-word'
|
||||
'ctrl-a': 'editor:move-to-first-character-of-line'
|
||||
'ctrl-e': 'editor:move-to-end-of-line'
|
||||
'ctrl-k': 'editor:cut-to-end-of-line'
|
||||
|
||||
# Atom Specific
|
||||
'ctrl-W': 'editor:select-word'
|
||||
|
||||
# Sublime Parity
|
||||
'meta-a': 'core:select-all'
|
||||
'meta-alt-p': 'editor:log-cursor-scope'
|
||||
'ctrl-t': 'editor:transpose'
|
||||
'meta-k meta-u': 'editor:upper-case'
|
||||
'meta-k meta-l': 'editor:lower-case'
|
||||
|
||||
'.editor:not(.mini)':
|
||||
# Atom Specific
|
||||
'alt-meta-z': 'editor:checkout-head-revision'
|
||||
'meta-<': 'editor:scroll-to-cursor'
|
||||
'ctrl-C': 'editor:copy-path'
|
||||
'alt-meta-ctrl-f': 'editor:fold-selection'
|
||||
'meta-=': 'editor:auto-indent'
|
||||
|
||||
# Sublime Parity
|
||||
'tab': 'editor:indent'
|
||||
'enter': 'editor:newline'
|
||||
'meta-enter': 'editor:newline-below'
|
||||
'meta-shift-enter': 'editor:newline-above'
|
||||
'meta-]': 'editor:indent-selected-rows'
|
||||
'meta-[': 'editor:outdent-selected-rows'
|
||||
'shift-tab': 'editor:outdent-selected-rows'
|
||||
'ctrl-meta-up': 'editor:move-line-up'
|
||||
'ctrl-meta-down': 'editor:move-line-down'
|
||||
'meta-/': 'editor:toggle-line-comments'
|
||||
'meta-j': 'editor:join-line'
|
||||
'meta-D': 'editor:duplicate-line'
|
||||
'ctrl-K': 'editor:delete-line'
|
||||
'ctrl-shift-up': 'editor:add-selection-above'
|
||||
'ctrl-shift-down': 'editor:add-selection-below'
|
||||
|
||||
'meta-alt-[': 'editor:fold-current-row'
|
||||
'meta-alt-]': 'editor:unfold-current-row'
|
||||
'meta-alt-{': 'editor:fold-all' # Atom Specific
|
||||
'meta-alt-}': 'editor:unfold-all' # Atom Specific
|
||||
'meta-k meta-0': 'editor:unfold-all'
|
||||
'meta-k meta-1': 'editor:fold-at-indent-level-1'
|
||||
'meta-k meta-2': 'editor:fold-at-indent-level-2'
|
||||
'meta-k meta-3': 'editor:fold-at-indent-level-3'
|
||||
'meta-k meta-4': 'editor:fold-at-indent-level-4'
|
||||
'meta-k meta-5': 'editor:fold-at-indent-level-5'
|
||||
'meta-k meta-6': 'editor:fold-at-indent-level-6'
|
||||
'meta-k meta-7': 'editor:fold-at-indent-level-7'
|
||||
'meta-k meta-8': 'editor:fold-at-indent-level-8'
|
||||
'meta-k meta-9': 'editor:fold-at-indent-level-9'
|
||||
|
||||
'.tool-panel':
|
||||
'escape': 'core:close'
|
||||
|
||||
'.tool-panel.panel-left, .tool-panel.panel-right':
|
||||
'escape': 'tool-panel:unfocus'
|
||||
|
||||
'.editor !important, .editor.mini !important':
|
||||
'escape': 'editor:consolidate-selections'
|
||||
|
||||
# allow standard input fields to work correctly
|
||||
'input:not(.hidden-input), .native-key-bindings':
|
||||
'tab': 'core:focus-next'
|
||||
'shift-tab': 'core:focus-previous'
|
||||
'left': 'native!'
|
||||
'right': 'native!'
|
||||
'shift-left': 'native!'
|
||||
'shift-right': 'native!'
|
||||
'backspace': 'native!'
|
||||
'shift-backspace': 'native!'
|
||||
'delete': 'native!'
|
||||
'meta-z': 'native!'
|
||||
'meta-Z': 'native!'
|
||||
'meta-x': 'native!'
|
||||
'meta-c': 'native!'
|
||||
'meta-v': 'native!'
|
||||
'ctrl-b': 'native!'
|
||||
'ctrl-f': 'native!'
|
||||
'ctrl-F': 'native!'
|
||||
'ctrl-B': 'native!'
|
||||
'ctrl-h': 'native!'
|
||||
'ctrl-d': 'native!'
|
||||
@@ -1,50 +0,0 @@
|
||||
'.editor':
|
||||
'ctrl-K': 'editor:delete-line'
|
||||
'ctrl-W': 'editor:select-word'
|
||||
'meta-alt-p': 'editor:log-cursor-scope'
|
||||
'meta-u': 'editor:upper-case'
|
||||
'meta-U': 'editor:lower-case'
|
||||
|
||||
'.editor:not(.mini)':
|
||||
'enter': 'editor:newline'
|
||||
'meta-enter': 'editor:newline-below'
|
||||
'meta-shift-enter': 'editor:newline-above'
|
||||
'tab': 'editor:indent'
|
||||
'meta-=': 'editor:auto-indent'
|
||||
|
||||
'ctrl-[': 'editor:fold-current-row'
|
||||
'ctrl-]': 'editor:unfold-current-row'
|
||||
'ctrl-{': 'editor:fold-all'
|
||||
'ctrl-}': 'editor:unfold-all'
|
||||
'ctrl-meta-1': 'editor:fold-at-indent-level-1'
|
||||
'ctrl-meta-2': 'editor:fold-at-indent-level-2'
|
||||
'ctrl-meta-3': 'editor:fold-at-indent-level-3'
|
||||
'ctrl-meta-4': 'editor:fold-at-indent-level-4'
|
||||
'ctrl-meta-5': 'editor:fold-at-indent-level-5'
|
||||
'ctrl-meta-6': 'editor:fold-at-indent-level-6'
|
||||
'ctrl-meta-7': 'editor:fold-at-indent-level-7'
|
||||
'ctrl-meta-8': 'editor:fold-at-indent-level-8'
|
||||
'ctrl-meta-9': 'editor:fold-at-indent-level-9'
|
||||
|
||||
'alt-shift-down': 'editor:add-selection-below'
|
||||
'alt-shift-up': 'editor:add-selection-above'
|
||||
'alt-meta-ctrl-f': 'editor:fold-selection'
|
||||
'shift-tab': 'editor:outdent-selected-rows'
|
||||
'meta-[': 'editor:outdent-selected-rows'
|
||||
'meta-]': 'editor:indent-selected-rows'
|
||||
|
||||
'meta-/': 'editor:toggle-line-comments'
|
||||
'ctrl-C': 'editor:copy-path'
|
||||
'ctrl-meta-up': 'editor:move-line-up'
|
||||
'ctrl-meta-down': 'editor:move-line-down'
|
||||
'meta-D': 'editor:duplicate-line'
|
||||
'meta-j': 'editor:join-line'
|
||||
'meta-<': 'editor:scroll-to-cursor'
|
||||
|
||||
'.editor.mini':
|
||||
'enter': 'core:confirm',
|
||||
'escape': 'core:cancel'
|
||||
'meta-w': 'core:cancel'
|
||||
|
||||
'.editor !important, .editor.mini !important':
|
||||
'escape': 'editor:consolidate-selections'
|
||||
@@ -1,33 +1,7 @@
|
||||
'body':
|
||||
'ctrl-p': 'core:move-up'
|
||||
'ctrl-n': 'core:move-down'
|
||||
'ctrl-b': 'core:move-left'
|
||||
'ctrl-f': 'core:move-right'
|
||||
'ctrl-P': 'core:select-up'
|
||||
'ctrl-N': 'core:select-down'
|
||||
'ctrl-F': 'core:select-right'
|
||||
'ctrl-B': 'core:select-left'
|
||||
'alt-ctrl-n': 'editor:add-selection-below'
|
||||
'alt-ctrl-p': 'editor:add-selection-above'
|
||||
'ctrl-h': 'core:backspace'
|
||||
'ctrl-d': 'core:delete'
|
||||
|
||||
'.editor':
|
||||
'alt-f': 'editor:move-to-end-of-word'
|
||||
'alt-F': 'editor:select-to-end-of-word'
|
||||
'alt-b': 'editor:move-to-beginning-of-word'
|
||||
'alt-B': 'editor:select-to-beginning-of-word'
|
||||
'ctrl-a': 'editor:move-to-first-character-of-line'
|
||||
'ctrl-e': 'editor:move-to-end-of-line'
|
||||
'alt-h': 'editor:backspace-to-beginning-of-word'
|
||||
'alt-d': 'editor:delete-to-end-of-word'
|
||||
'ctrl-k': 'editor:cut-to-end-of-line'
|
||||
|
||||
# allow standard input fields to work correctly
|
||||
'input:not(.hidden-input)':
|
||||
'ctrl-b': 'native!'
|
||||
'ctrl-f': 'native!'
|
||||
'ctrl-F': 'native!'
|
||||
'ctrl-B': 'native!'
|
||||
'ctrl-h': 'native!'
|
||||
'ctrl-d': 'native!'
|
||||
|
||||
@@ -1,2 +0,0 @@
|
||||
'.editor':
|
||||
'alt-meta-z': 'editor:checkout-head-revision'
|
||||
@@ -1,4 +0,0 @@
|
||||
'.select-list .mini.editor':
|
||||
'enter': 'core:confirm'
|
||||
'escape': 'core:cancel'
|
||||
'meta-w': 'core:cancel'
|
||||
14
package.json
14
package.json
@@ -73,15 +73,15 @@
|
||||
"autocomplete": "0.11.0",
|
||||
"autoflow": "0.5.0",
|
||||
"autosave": "0.6.0",
|
||||
"bookmarks": "0.8.0",
|
||||
"bracket-matcher": "0.7.0",
|
||||
"bookmarks": "0.10.0",
|
||||
"bracket-matcher": "0.8.0",
|
||||
"command-logger": "0.6.0",
|
||||
"command-palette": "0.6.0",
|
||||
"dev-live-reload": "0.13.0",
|
||||
"editor-stats": "0.5.0",
|
||||
"exception-reporting": "0.5.0",
|
||||
"find-and-replace": "0.35.0",
|
||||
"fuzzy-finder": "0.16.0",
|
||||
"fuzzy-finder": "0.19.0",
|
||||
"gists": "0.6.0",
|
||||
"git-diff": "0.13.0",
|
||||
"github-sign-in": "0.9.0",
|
||||
@@ -89,21 +89,21 @@
|
||||
"grammar-selector": "0.8.0",
|
||||
"image-view": "0.7.0",
|
||||
"link": "0.7.0",
|
||||
"markdown-preview": "0.13.0",
|
||||
"markdown-preview": "0.15.0",
|
||||
"metrics": "0.8.0",
|
||||
"package-generator": "0.14.0",
|
||||
"release-notes": "0.11.0",
|
||||
"settings-view": "0.37.0",
|
||||
"snippets": "0.13.0",
|
||||
"spell-check": "0.9.0",
|
||||
"spell-check": "0.11.0",
|
||||
"status-bar": "0.15.1",
|
||||
"styleguide": "0.9.0",
|
||||
"symbols-view": "0.15.0",
|
||||
"symbols-view": "0.17.0",
|
||||
"tabs": "0.7.2",
|
||||
"terminal": "0.15.0",
|
||||
"timecop": "0.9.0",
|
||||
"to-the-hubs": "0.8.0",
|
||||
"tree-view": "0.23.0",
|
||||
"tree-view": "0.25.0",
|
||||
"visual-bell": "0.3.0",
|
||||
"whitespace": "0.8.0",
|
||||
"wrap-guide": "0.4.0",
|
||||
|
||||
@@ -203,6 +203,7 @@ describe "Keymap", ->
|
||||
describe "when a second keystroke added to the first to match a multi-stroke binding completely", ->
|
||||
it "triggers the event associated with the matched multi-stroke binding", ->
|
||||
expect(keymap.handleKeyEvent(keydownEvent('x', target: fragment[0], ctrlKey: true))).toBeFalsy()
|
||||
expect(keymap.handleKeyEvent(keydownEvent('ctrl', target: fragment[0]))).toBeFalsy() # This simulates actual key event behavior
|
||||
expect(keymap.handleKeyEvent(keydownEvent('c', target: fragment[0], ctrlKey: true))).toBeFalsy()
|
||||
|
||||
expect(quitHandler).toHaveBeenCalled()
|
||||
|
||||
@@ -6,6 +6,8 @@ CSON = require 'season'
|
||||
BindingSet = require './binding-set'
|
||||
{Emitter} = require 'emissary'
|
||||
|
||||
Modifiers = ['alt', 'control', 'ctrl', 'shift', 'meta']
|
||||
|
||||
# Internal: Associates keymaps with actions.
|
||||
#
|
||||
# Keymaps are defined in a CSON format. A typical keymap looks something like this:
|
||||
@@ -175,7 +177,10 @@ class Keymap
|
||||
multiKeystrokeStringForEvent: (event) ->
|
||||
currentKeystroke = @keystrokeStringForEvent(event)
|
||||
if @queuedKeystrokes
|
||||
@queuedKeystrokes + ' ' + currentKeystroke
|
||||
if currentKeystroke in Modifiers
|
||||
@queuedKeystrokes
|
||||
else
|
||||
@queuedKeystrokes + ' ' + currentKeystroke
|
||||
else
|
||||
currentKeystroke
|
||||
|
||||
@@ -189,14 +194,14 @@ class Keymap
|
||||
key = event.originalEvent.keyIdentifier.toLowerCase()
|
||||
|
||||
modifiers = []
|
||||
if event.altKey and key isnt 'alt'
|
||||
if event.altKey and key not in Modifiers
|
||||
modifiers.push 'alt'
|
||||
if event.ctrlKey and key isnt 'ctrl'
|
||||
if event.ctrlKey and key not in Modifiers
|
||||
modifiers.push 'ctrl'
|
||||
if event.metaKey and key isnt 'meta'
|
||||
if event.metaKey and key not in Modifiers
|
||||
modifiers.push 'meta'
|
||||
|
||||
if event.shiftKey
|
||||
if event.shiftKey and key not in Modifiers
|
||||
isNamedKey = key.length > 1
|
||||
modifiers.push 'shift' if isNamedKey
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user