Blink Reformat | 4c46d09 | 2018-04-07 15:32:37 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2010 Google Inc. All rights reserved. |
| 3 | * |
| 4 | * Redistribution and use in source and binary forms, with or without |
| 5 | * modification, are permitted provided that the following conditions are |
| 6 | * met: |
| 7 | * |
| 8 | * * Redistributions of source code must retain the above copyright |
| 9 | * notice, this list of conditions and the following disclaimer. |
| 10 | * * Redistributions in binary form must reproduce the above |
| 11 | * copyright notice, this list of conditions and the following disclaimer |
| 12 | * in the documentation and/or other materials provided with the |
| 13 | * distribution. |
| 14 | * * Neither the name of Google Inc. nor the names of its |
| 15 | * contributors may be used to endorse or promote products derived from |
| 16 | * this software without specific prior written permission. |
| 17 | * |
| 18 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |
| 19 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |
| 20 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR |
| 21 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT |
| 22 | * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
| 23 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
| 24 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
| 25 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
| 26 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 27 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 28 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 29 | */ |
| 30 | |
Paul Lewis | 9950e18 | 2019-12-16 16:06:07 | [diff] [blame^] | 31 | import {KeyboardShortcut, Keys, Modifiers} from './KeyboardShortcut.js'; |
| 32 | import {createDocumentationLink} from './UIUtils.js'; |
| 33 | import {Widget} from './Widget.js'; |
| 34 | |
Blink Reformat | 4c46d09 | 2018-04-07 15:32:37 | [diff] [blame] | 35 | /** |
| 36 | * @unrestricted |
| 37 | */ |
Paul Lewis | 9950e18 | 2019-12-16 16:06:07 | [diff] [blame^] | 38 | export class ShortcutsScreen { |
Blink Reformat | 4c46d09 | 2018-04-07 15:32:37 | [diff] [blame] | 39 | constructor() { |
Tim van der Lippe | 0830b3d | 2019-10-03 13:20:07 | [diff] [blame] | 40 | /** @type {!Object.<string, !ShortcutsSection>} */ |
Blink Reformat | 4c46d09 | 2018-04-07 15:32:37 | [diff] [blame] | 41 | this._sections = {}; |
| 42 | } |
| 43 | |
| 44 | static registerShortcuts() { |
| 45 | // Elements panel |
| 46 | const elementsSection = UI.shortcutsScreen.section(Common.UIString('Elements Panel')); |
| 47 | |
Tim van der Lippe | 0830b3d | 2019-10-03 13:20:07 | [diff] [blame] | 48 | const navigate = ElementsPanelShortcuts.NavigateUp.concat(ElementsPanelShortcuts.NavigateDown); |
Blink Reformat | 4c46d09 | 2018-04-07 15:32:37 | [diff] [blame] | 49 | elementsSection.addRelatedKeys(navigate, Common.UIString('Navigate elements')); |
| 50 | |
Tim van der Lippe | 0830b3d | 2019-10-03 13:20:07 | [diff] [blame] | 51 | const expandCollapse = ElementsPanelShortcuts.Expand.concat(ElementsPanelShortcuts.Collapse); |
Blink Reformat | 4c46d09 | 2018-04-07 15:32:37 | [diff] [blame] | 52 | elementsSection.addRelatedKeys(expandCollapse, Common.UIString('Expand/collapse')); |
| 53 | |
Tim van der Lippe | 0830b3d | 2019-10-03 13:20:07 | [diff] [blame] | 54 | elementsSection.addAlternateKeys(ElementsPanelShortcuts.EditAttribute, Common.UIString('Edit attribute')); |
Blink Reformat | 4c46d09 | 2018-04-07 15:32:37 | [diff] [blame] | 55 | elementsSection.addAlternateKeys( |
Joel Einbinder | a66e5bf | 2018-05-31 01:26:37 | [diff] [blame] | 56 | UI.shortcutRegistry.shortcutDescriptorsForAction('elements.hide-element'), Common.UIString('Hide element')); |
Blink Reformat | 4c46d09 | 2018-04-07 15:32:37 | [diff] [blame] | 57 | elementsSection.addAlternateKeys( |
Joel Einbinder | a66e5bf | 2018-05-31 01:26:37 | [diff] [blame] | 58 | UI.shortcutRegistry.shortcutDescriptorsForAction('elements.edit-as-html'), |
| 59 | Common.UIString('Toggle edit as HTML')); |
Blink Reformat | 4c46d09 | 2018-04-07 15:32:37 | [diff] [blame] | 60 | |
Fabio Rocha | f0d9547 | 2019-05-28 21:35:19 | [diff] [blame] | 61 | // Styles pane |
Blink Reformat | 4c46d09 | 2018-04-07 15:32:37 | [diff] [blame] | 62 | const stylesPaneSection = UI.shortcutsScreen.section(Common.UIString('Styles Pane')); |
| 63 | |
Tim van der Lippe | 0830b3d | 2019-10-03 13:20:07 | [diff] [blame] | 64 | const nextPreviousProperty = ElementsPanelShortcuts.NextProperty.concat(ElementsPanelShortcuts.PreviousProperty); |
Blink Reformat | 4c46d09 | 2018-04-07 15:32:37 | [diff] [blame] | 65 | stylesPaneSection.addRelatedKeys(nextPreviousProperty, Common.UIString('Next/previous property')); |
| 66 | |
Tim van der Lippe | 0830b3d | 2019-10-03 13:20:07 | [diff] [blame] | 67 | stylesPaneSection.addRelatedKeys(ElementsPanelShortcuts.IncrementValue, Common.UIString('Increment value')); |
| 68 | stylesPaneSection.addRelatedKeys(ElementsPanelShortcuts.DecrementValue, Common.UIString('Decrement value')); |
Blink Reformat | 4c46d09 | 2018-04-07 15:32:37 | [diff] [blame] | 69 | |
Tim van der Lippe | 0830b3d | 2019-10-03 13:20:07 | [diff] [blame] | 70 | stylesPaneSection.addAlternateKeys(ElementsPanelShortcuts.IncrementBy10, Common.UIString('Increment by %f', 10)); |
| 71 | stylesPaneSection.addAlternateKeys(ElementsPanelShortcuts.DecrementBy10, Common.UIString('Decrement by %f', 10)); |
Blink Reformat | 4c46d09 | 2018-04-07 15:32:37 | [diff] [blame] | 72 | |
Tim van der Lippe | 0830b3d | 2019-10-03 13:20:07 | [diff] [blame] | 73 | stylesPaneSection.addAlternateKeys(ElementsPanelShortcuts.IncrementBy100, Common.UIString('Increment by %f', 100)); |
| 74 | stylesPaneSection.addAlternateKeys(ElementsPanelShortcuts.DecrementBy100, Common.UIString('Decrement by %f', 100)); |
Blink Reformat | 4c46d09 | 2018-04-07 15:32:37 | [diff] [blame] | 75 | |
Tim van der Lippe | 0830b3d | 2019-10-03 13:20:07 | [diff] [blame] | 76 | stylesPaneSection.addAlternateKeys(ElementsPanelShortcuts.IncrementBy01, Common.UIString('Increment by %f', 0.1)); |
| 77 | stylesPaneSection.addAlternateKeys(ElementsPanelShortcuts.DecrementBy01, Common.UIString('Decrement by %f', 0.1)); |
Blink Reformat | 4c46d09 | 2018-04-07 15:32:37 | [diff] [blame] | 78 | |
Fabio Rocha | f0d9547 | 2019-05-28 21:35:19 | [diff] [blame] | 79 | // Console |
| 80 | const consoleSection = UI.shortcutsScreen.section(Common.UIString('Console')); |
Blink Reformat | 4c46d09 | 2018-04-07 15:32:37 | [diff] [blame] | 81 | |
Fabio Rocha | f0d9547 | 2019-05-28 21:35:19 | [diff] [blame] | 82 | consoleSection.addAlternateKeys( |
| 83 | UI.shortcutRegistry.shortcutDescriptorsForAction('console.clear'), Common.UIString('Clear console')); |
Tim van der Lippe | 0830b3d | 2019-10-03 13:20:07 | [diff] [blame] | 84 | consoleSection.addRelatedKeys(ConsolePanelShortcuts.AcceptSuggestion, Common.UIString('Accept suggestion')); |
| 85 | consoleSection.addAlternateKeys(ConsolePanelShortcuts.ClearConsolePrompt, Common.UIString('Clear console prompt')); |
| 86 | consoleSection.addRelatedKeys(ConsolePanelShortcuts.NextPreviousLine, Common.UIString('Next/previous line')); |
Fabio Rocha | f0d9547 | 2019-05-28 21:35:19 | [diff] [blame] | 87 | |
| 88 | if (Host.isMac()) { |
| 89 | consoleSection.addRelatedKeys( |
Tim van der Lippe | 0830b3d | 2019-10-03 13:20:07 | [diff] [blame] | 90 | ConsolePanelShortcuts.NextPreviousCommand, Common.UIString('Next/previous command')); |
Fabio Rocha | f0d9547 | 2019-05-28 21:35:19 | [diff] [blame] | 91 | } |
| 92 | |
Tim van der Lippe | 0830b3d | 2019-10-03 13:20:07 | [diff] [blame] | 93 | consoleSection.addKey(ConsolePanelShortcuts.ExecuteCommand, Common.UIString('Execute command')); |
Fabio Rocha | f0d9547 | 2019-05-28 21:35:19 | [diff] [blame] | 94 | |
| 95 | // Debugger |
| 96 | const debuggerSection = UI.shortcutsScreen.section(Common.UIString('Debugger')); |
| 97 | |
| 98 | debuggerSection.addAlternateKeys( |
Blink Reformat | 4c46d09 | 2018-04-07 15:32:37 | [diff] [blame] | 99 | UI.shortcutRegistry.shortcutDescriptorsForAction('debugger.toggle-pause'), Common.UIString('Pause/ Continue')); |
Fabio Rocha | f0d9547 | 2019-05-28 21:35:19 | [diff] [blame] | 100 | debuggerSection.addAlternateKeys( |
Blink Reformat | 4c46d09 | 2018-04-07 15:32:37 | [diff] [blame] | 101 | UI.shortcutRegistry.shortcutDescriptorsForAction('debugger.step-over'), Common.UIString('Step over')); |
Fabio Rocha | f0d9547 | 2019-05-28 21:35:19 | [diff] [blame] | 102 | debuggerSection.addAlternateKeys( |
Blink Reformat | 4c46d09 | 2018-04-07 15:32:37 | [diff] [blame] | 103 | UI.shortcutRegistry.shortcutDescriptorsForAction('debugger.step-into'), Common.UIString('Step into')); |
Fabio Rocha | f0d9547 | 2019-05-28 21:35:19 | [diff] [blame] | 104 | debuggerSection.addAlternateKeys( |
Blink Reformat | 4c46d09 | 2018-04-07 15:32:37 | [diff] [blame] | 105 | UI.shortcutRegistry.shortcutDescriptorsForAction('debugger.step-out'), Common.UIString('Step out')); |
| 106 | |
| 107 | const nextAndPrevFrameKeys = |
| 108 | UI.shortcutRegistry.shortcutDescriptorsForAction('debugger.next-call-frame') |
| 109 | .concat(UI.shortcutRegistry.shortcutDescriptorsForAction('debugger.previous-call-frame')); |
Fabio Rocha | f0d9547 | 2019-05-28 21:35:19 | [diff] [blame] | 110 | debuggerSection.addRelatedKeys(nextAndPrevFrameKeys, Common.UIString('Next/previous call frame')); |
Blink Reformat | 4c46d09 | 2018-04-07 15:32:37 | [diff] [blame] | 111 | |
Fabio Rocha | f0d9547 | 2019-05-28 21:35:19 | [diff] [blame] | 112 | debuggerSection.addAlternateKeys( |
Tim van der Lippe | 0830b3d | 2019-10-03 13:20:07 | [diff] [blame] | 113 | SourcesPanelShortcuts.EvaluateSelectionInConsole, Common.UIString('Evaluate selection in console')); |
Fabio Rocha | f0d9547 | 2019-05-28 21:35:19 | [diff] [blame] | 114 | debuggerSection.addAlternateKeys( |
Tim van der Lippe | 0830b3d | 2019-10-03 13:20:07 | [diff] [blame] | 115 | SourcesPanelShortcuts.AddSelectionToWatch, Common.UIString('Add selection to watch')); |
Fabio Rocha | f0d9547 | 2019-05-28 21:35:19 | [diff] [blame] | 116 | debuggerSection.addAlternateKeys( |
Blink Reformat | 4c46d09 | 2018-04-07 15:32:37 | [diff] [blame] | 117 | UI.shortcutRegistry.shortcutDescriptorsForAction('debugger.toggle-breakpoint'), |
| 118 | Common.UIString('Toggle breakpoint')); |
Fabio Rocha | f0d9547 | 2019-05-28 21:35:19 | [diff] [blame] | 119 | debuggerSection.addAlternateKeys( |
Blink Reformat | 4c46d09 | 2018-04-07 15:32:37 | [diff] [blame] | 120 | UI.shortcutRegistry.shortcutDescriptorsForAction('debugger.toggle-breakpoint-enabled'), |
| 121 | Common.UIString('Toggle breakpoint enabled')); |
Fabio Rocha | f0d9547 | 2019-05-28 21:35:19 | [diff] [blame] | 122 | debuggerSection.addAlternateKeys( |
Blink Reformat | 4c46d09 | 2018-04-07 15:32:37 | [diff] [blame] | 123 | UI.shortcutRegistry.shortcutDescriptorsForAction('debugger.toggle-breakpoints-active'), |
| 124 | Common.UIString('Toggle all breakpoints')); |
Olivia Flynn | 8e746e0 | 2019-06-19 17:06:23 | [diff] [blame] | 125 | debuggerSection.addAlternateKeys( |
| 126 | UI.shortcutRegistry.shortcutDescriptorsForAction('debugger.breakpoint-input-window'), |
| 127 | ls`Open breakpoint editor`); |
Blink Reformat | 4c46d09 | 2018-04-07 15:32:37 | [diff] [blame] | 128 | |
| 129 | // Editing |
Fabio Rocha | f0d9547 | 2019-05-28 21:35:19 | [diff] [blame] | 130 | const editingSection = UI.shortcutsScreen.section(Common.UIString('Text Editor')); |
| 131 | |
| 132 | editingSection.addAlternateKeys( |
Blink Reformat | 4c46d09 | 2018-04-07 15:32:37 | [diff] [blame] | 133 | UI.shortcutRegistry.shortcutDescriptorsForAction('sources.go-to-member'), Common.UIString('Go to member')); |
Tim van der Lippe | 0830b3d | 2019-10-03 13:20:07 | [diff] [blame] | 134 | editingSection.addAlternateKeys(SourcesPanelShortcuts.ToggleAutocompletion, Common.UIString('Autocompletion')); |
Fabio Rocha | f0d9547 | 2019-05-28 21:35:19 | [diff] [blame] | 135 | editingSection.addAlternateKeys( |
Blink Reformat | 4c46d09 | 2018-04-07 15:32:37 | [diff] [blame] | 136 | UI.shortcutRegistry.shortcutDescriptorsForAction('sources.go-to-line'), Common.UIString('Go to line')); |
Fabio Rocha | f0d9547 | 2019-05-28 21:35:19 | [diff] [blame] | 137 | editingSection.addAlternateKeys( |
Blink Reformat | 4c46d09 | 2018-04-07 15:32:37 | [diff] [blame] | 138 | UI.shortcutRegistry.shortcutDescriptorsForAction('sources.jump-to-previous-location'), |
| 139 | Common.UIString('Jump to previous editing location')); |
Fabio Rocha | f0d9547 | 2019-05-28 21:35:19 | [diff] [blame] | 140 | editingSection.addAlternateKeys( |
Blink Reformat | 4c46d09 | 2018-04-07 15:32:37 | [diff] [blame] | 141 | UI.shortcutRegistry.shortcutDescriptorsForAction('sources.jump-to-next-location'), |
| 142 | Common.UIString('Jump to next editing location')); |
Tim van der Lippe | 0830b3d | 2019-10-03 13:20:07 | [diff] [blame] | 143 | editingSection.addAlternateKeys(SourcesPanelShortcuts.ToggleComment, Common.UIString('Toggle comment')); |
Fabio Rocha | f0d9547 | 2019-05-28 21:35:19 | [diff] [blame] | 144 | editingSection.addAlternateKeys( |
Tim van der Lippe | 0830b3d | 2019-10-03 13:20:07 | [diff] [blame] | 145 | SourcesPanelShortcuts.IncreaseCSSUnitByOne, Common.UIString('Increment CSS unit by 1')); |
Fabio Rocha | f0d9547 | 2019-05-28 21:35:19 | [diff] [blame] | 146 | editingSection.addAlternateKeys( |
Tim van der Lippe | 0830b3d | 2019-10-03 13:20:07 | [diff] [blame] | 147 | SourcesPanelShortcuts.DecreaseCSSUnitByOne, Common.UIString('Decrement CSS unit by 1')); |
Fabio Rocha | f0d9547 | 2019-05-28 21:35:19 | [diff] [blame] | 148 | editingSection.addAlternateKeys( |
Tim van der Lippe | 0830b3d | 2019-10-03 13:20:07 | [diff] [blame] | 149 | SourcesPanelShortcuts.IncreaseCSSUnitByTen, Common.UIString('Increment CSS unit by 10')); |
Fabio Rocha | f0d9547 | 2019-05-28 21:35:19 | [diff] [blame] | 150 | editingSection.addAlternateKeys( |
Tim van der Lippe | 0830b3d | 2019-10-03 13:20:07 | [diff] [blame] | 151 | SourcesPanelShortcuts.DecreaseCSSUnitByTen, Common.UIString('Decrement CSS unit by 10')); |
Fabio Rocha | f0d9547 | 2019-05-28 21:35:19 | [diff] [blame] | 152 | editingSection.addAlternateKeys( |
Tim van der Lippe | 0830b3d | 2019-10-03 13:20:07 | [diff] [blame] | 153 | SourcesPanelShortcuts.SelectNextOccurrence, Common.UIString('Select next occurrence')); |
| 154 | editingSection.addAlternateKeys(SourcesPanelShortcuts.SoftUndo, Common.UIString('Soft undo')); |
Fabio Rocha | f0d9547 | 2019-05-28 21:35:19 | [diff] [blame] | 155 | editingSection.addAlternateKeys( |
Tim van der Lippe | 0830b3d | 2019-10-03 13:20:07 | [diff] [blame] | 156 | SourcesPanelShortcuts.GotoMatchingBracket, Common.UIString('Go to matching bracket')); |
Fabio Rocha | f0d9547 | 2019-05-28 21:35:19 | [diff] [blame] | 157 | editingSection.addAlternateKeys( |
Blink Reformat | 4c46d09 | 2018-04-07 15:32:37 | [diff] [blame] | 158 | UI.shortcutRegistry.shortcutDescriptorsForAction('sources.close-editor-tab'), |
| 159 | Common.UIString('Close editor tab')); |
Fabio Rocha | f0d9547 | 2019-05-28 21:35:19 | [diff] [blame] | 160 | editingSection.addAlternateKeys( |
Blink Reformat | 4c46d09 | 2018-04-07 15:32:37 | [diff] [blame] | 161 | UI.shortcutRegistry.shortcutDescriptorsForAction('sources.switch-file'), |
| 162 | Common.UIString('Switch between files with the same name and different extensions.')); |
| 163 | |
| 164 | // Performance panel |
Fabio Rocha | f0d9547 | 2019-05-28 21:35:19 | [diff] [blame] | 165 | const performanceSection = UI.shortcutsScreen.section(Common.UIString('Performance Panel')); |
| 166 | |
| 167 | performanceSection.addAlternateKeys( |
Blink Reformat | 4c46d09 | 2018-04-07 15:32:37 | [diff] [blame] | 168 | UI.shortcutRegistry.shortcutDescriptorsForAction('timeline.toggle-recording'), |
| 169 | Common.UIString('Start/stop recording')); |
Fabio Rocha | f0d9547 | 2019-05-28 21:35:19 | [diff] [blame] | 170 | performanceSection.addAlternateKeys( |
Blink Reformat | 4c46d09 | 2018-04-07 15:32:37 | [diff] [blame] | 171 | UI.shortcutRegistry.shortcutDescriptorsForAction('timeline.record-reload'), |
| 172 | Common.UIString('Record page reload')); |
Fabio Rocha | f0d9547 | 2019-05-28 21:35:19 | [diff] [blame] | 173 | performanceSection.addAlternateKeys( |
Blink Reformat | 4c46d09 | 2018-04-07 15:32:37 | [diff] [blame] | 174 | UI.shortcutRegistry.shortcutDescriptorsForAction('timeline.save-to-file'), Common.UIString('Save profile')); |
Fabio Rocha | f0d9547 | 2019-05-28 21:35:19 | [diff] [blame] | 175 | performanceSection.addAlternateKeys( |
Blink Reformat | 4c46d09 | 2018-04-07 15:32:37 | [diff] [blame] | 176 | UI.shortcutRegistry.shortcutDescriptorsForAction('timeline.load-from-file'), Common.UIString('Load profile')); |
Fabio Rocha | f0d9547 | 2019-05-28 21:35:19 | [diff] [blame] | 177 | performanceSection.addRelatedKeys( |
Blink Reformat | 4c46d09 | 2018-04-07 15:32:37 | [diff] [blame] | 178 | UI.shortcutRegistry.shortcutDescriptorsForAction('timeline.jump-to-previous-frame') |
| 179 | .concat(UI.shortcutRegistry.shortcutDescriptorsForAction('timeline.jump-to-next-frame')), |
| 180 | Common.UIString('Jump to previous/next frame')); |
Fabio Rocha | f0d9547 | 2019-05-28 21:35:19 | [diff] [blame] | 181 | performanceSection.addRelatedKeys( |
Blink Reformat | 4c46d09 | 2018-04-07 15:32:37 | [diff] [blame] | 182 | UI.shortcutRegistry.shortcutDescriptorsForAction('timeline.show-history'), |
| 183 | Common.UIString('Pick a recording from history')); |
Fabio Rocha | f0d9547 | 2019-05-28 21:35:19 | [diff] [blame] | 184 | performanceSection.addRelatedKeys( |
Blink Reformat | 4c46d09 | 2018-04-07 15:32:37 | [diff] [blame] | 185 | UI.shortcutRegistry.shortcutDescriptorsForAction('timeline.previous-recording') |
| 186 | .concat(UI.shortcutRegistry.shortcutDescriptorsForAction('timeline.next-recording')), |
| 187 | Common.UIString('Show previous/next recording')); |
| 188 | |
| 189 | // Memory panel |
Fabio Rocha | f0d9547 | 2019-05-28 21:35:19 | [diff] [blame] | 190 | const memorySection = UI.shortcutsScreen.section(Common.UIString('Memory Panel')); |
| 191 | |
| 192 | memorySection.addAlternateKeys( |
Blink Reformat | 4c46d09 | 2018-04-07 15:32:37 | [diff] [blame] | 193 | UI.shortcutRegistry.shortcutDescriptorsForAction('profiler.heap-toggle-recording'), |
| 194 | Common.UIString('Start/stop recording')); |
| 195 | |
| 196 | // Layers panel |
Fabio Rocha | f0d9547 | 2019-05-28 21:35:19 | [diff] [blame] | 197 | const layersSection = UI.shortcutsScreen.section(Common.UIString('Layers Panel')); |
| 198 | |
Tim van der Lippe | 0830b3d | 2019-10-03 13:20:07 | [diff] [blame] | 199 | layersSection.addAlternateKeys(LayersPanelShortcuts.ResetView, Common.UIString('Reset view')); |
| 200 | layersSection.addAlternateKeys(LayersPanelShortcuts.PanMode, Common.UIString('Switch to pan mode')); |
| 201 | layersSection.addAlternateKeys(LayersPanelShortcuts.RotateMode, Common.UIString('Switch to rotate mode')); |
Fabio Rocha | f0d9547 | 2019-05-28 21:35:19 | [diff] [blame] | 202 | layersSection.addAlternateKeys( |
Tim van der Lippe | 0830b3d | 2019-10-03 13:20:07 | [diff] [blame] | 203 | LayersPanelShortcuts.TogglePanRotate, Common.UIString('Temporarily toggle pan/rotate mode while held')); |
| 204 | layersSection.addAlternateKeys(LayersPanelShortcuts.ZoomIn, Common.UIString('Zoom in')); |
| 205 | layersSection.addAlternateKeys(LayersPanelShortcuts.ZoomOut, Common.UIString('Zoom out')); |
Fabio Rocha | f0d9547 | 2019-05-28 21:35:19 | [diff] [blame] | 206 | layersSection.addRelatedKeys( |
Tim van der Lippe | 0830b3d | 2019-10-03 13:20:07 | [diff] [blame] | 207 | LayersPanelShortcuts.Up.concat(LayersPanelShortcuts.Down), Common.UIString('Pan or rotate up/down')); |
Fabio Rocha | f0d9547 | 2019-05-28 21:35:19 | [diff] [blame] | 208 | layersSection.addRelatedKeys( |
Tim van der Lippe | 0830b3d | 2019-10-03 13:20:07 | [diff] [blame] | 209 | LayersPanelShortcuts.Left.concat(LayersPanelShortcuts.Right), Common.UIString('Pan or rotate left/right')); |
Blink Reformat | 4c46d09 | 2018-04-07 15:32:37 | [diff] [blame] | 210 | } |
| 211 | |
| 212 | /** |
| 213 | * @param {string} name |
Tim van der Lippe | 0830b3d | 2019-10-03 13:20:07 | [diff] [blame] | 214 | * @return {!ShortcutsSection} |
Blink Reformat | 4c46d09 | 2018-04-07 15:32:37 | [diff] [blame] | 215 | */ |
| 216 | section(name) { |
| 217 | let section = this._sections[name]; |
Tim van der Lippe | 1d6e57a | 2019-09-30 11:55:34 | [diff] [blame] | 218 | if (!section) { |
Tim van der Lippe | 0830b3d | 2019-10-03 13:20:07 | [diff] [blame] | 219 | this._sections[name] = section = new ShortcutsSection(name); |
Tim van der Lippe | 1d6e57a | 2019-09-30 11:55:34 | [diff] [blame] | 220 | } |
Blink Reformat | 4c46d09 | 2018-04-07 15:32:37 | [diff] [blame] | 221 | return section; |
| 222 | } |
| 223 | |
| 224 | /** |
Paul Lewis | 9950e18 | 2019-12-16 16:06:07 | [diff] [blame^] | 225 | * @return {!Widget} |
Blink Reformat | 4c46d09 | 2018-04-07 15:32:37 | [diff] [blame] | 226 | */ |
| 227 | createShortcutsTabView() { |
| 228 | const orderedSections = []; |
Tim van der Lippe | 1d6e57a | 2019-09-30 11:55:34 | [diff] [blame] | 229 | for (const section in this._sections) { |
Blink Reformat | 4c46d09 | 2018-04-07 15:32:37 | [diff] [blame] | 230 | orderedSections.push(this._sections[section]); |
Tim van der Lippe | 1d6e57a | 2019-09-30 11:55:34 | [diff] [blame] | 231 | } |
Blink Reformat | 4c46d09 | 2018-04-07 15:32:37 | [diff] [blame] | 232 | function compareSections(a, b) { |
| 233 | return a.order - b.order; |
| 234 | } |
| 235 | orderedSections.sort(compareSections); |
| 236 | |
Paul Lewis | 9950e18 | 2019-12-16 16:06:07 | [diff] [blame^] | 237 | const widget = new Widget(); |
Blink Reformat | 4c46d09 | 2018-04-07 15:32:37 | [diff] [blame] | 238 | |
| 239 | widget.element.className = 'settings-tab-container'; // Override |
Chandani Shrestha | 83bd7c9 | 2019-06-11 21:21:59 | [diff] [blame] | 240 | widget.element.createChild('header').createChild('h1').createTextChild(ls`Shortcuts`); |
Blink Reformat | 4c46d09 | 2018-04-07 15:32:37 | [diff] [blame] | 241 | const scrollPane = widget.element.createChild('div', 'settings-container-wrapper'); |
| 242 | const container = scrollPane.createChild('div'); |
| 243 | container.className = 'settings-content settings-container'; |
Tim van der Lippe | 1d6e57a | 2019-09-30 11:55:34 | [diff] [blame] | 244 | for (let i = 0; i < orderedSections.length; ++i) { |
Blink Reformat | 4c46d09 | 2018-04-07 15:32:37 | [diff] [blame] | 245 | orderedSections[i].renderSection(container); |
Tim van der Lippe | 1d6e57a | 2019-09-30 11:55:34 | [diff] [blame] | 246 | } |
Blink Reformat | 4c46d09 | 2018-04-07 15:32:37 | [diff] [blame] | 247 | |
| 248 | const note = scrollPane.createChild('p', 'settings-footnote'); |
Paul Lewis | 9950e18 | 2019-12-16 16:06:07 | [diff] [blame^] | 249 | note.appendChild(createDocumentationLink( |
Blink Reformat | 4c46d09 | 2018-04-07 15:32:37 | [diff] [blame] | 250 | 'iterate/inspect-styles/shortcuts', Common.UIString('Full list of DevTools keyboard shortcuts and gestures'))); |
| 251 | |
| 252 | return widget; |
| 253 | } |
Tim van der Lippe | 0830b3d | 2019-10-03 13:20:07 | [diff] [blame] | 254 | } |
Blink Reformat | 4c46d09 | 2018-04-07 15:32:37 | [diff] [blame] | 255 | |
| 256 | /** |
Blink Reformat | 4c46d09 | 2018-04-07 15:32:37 | [diff] [blame] | 257 | * @unrestricted |
| 258 | */ |
Tim van der Lippe | c96ccd9 | 2019-11-29 16:23:54 | [diff] [blame] | 259 | class ShortcutsSection { |
Blink Reformat | 4c46d09 | 2018-04-07 15:32:37 | [diff] [blame] | 260 | /** |
| 261 | * @param {string} name |
| 262 | */ |
| 263 | constructor(name) { |
| 264 | this.name = name; |
| 265 | this._lines = /** @type {!Array.<!{key: !Node, text: string}>} */ ([]); |
Tim van der Lippe | 0830b3d | 2019-10-03 13:20:07 | [diff] [blame] | 266 | this.order = ++ShortcutsSection._sequenceNumber; |
Blink Reformat | 4c46d09 | 2018-04-07 15:32:37 | [diff] [blame] | 267 | } |
| 268 | |
| 269 | /** |
| 270 | * @param {!UI.KeyboardShortcut.Descriptor} key |
| 271 | * @param {string} description |
| 272 | */ |
| 273 | addKey(key, description) { |
| 274 | this._addLine(this._renderKey(key), description); |
| 275 | } |
| 276 | |
| 277 | /** |
| 278 | * @param {!Array.<!UI.KeyboardShortcut.Descriptor>} keys |
| 279 | * @param {string} description |
| 280 | */ |
| 281 | addRelatedKeys(keys, description) { |
| 282 | this._addLine(this._renderSequence(keys, '/'), description); |
| 283 | } |
| 284 | |
| 285 | /** |
| 286 | * @param {!Array.<!UI.KeyboardShortcut.Descriptor>} keys |
| 287 | * @param {string} description |
| 288 | */ |
| 289 | addAlternateKeys(keys, description) { |
| 290 | this._addLine(this._renderSequence(keys, Common.UIString('or')), description); |
| 291 | } |
| 292 | |
| 293 | /** |
| 294 | * @param {!Node} keyElement |
| 295 | * @param {string} description |
| 296 | */ |
| 297 | _addLine(keyElement, description) { |
| 298 | this._lines.push({key: keyElement, text: description}); |
| 299 | } |
| 300 | |
| 301 | /** |
| 302 | * @param {!Element} container |
| 303 | */ |
| 304 | renderSection(container) { |
| 305 | const parent = container.createChild('div', 'settings-block'); |
| 306 | |
| 307 | const headLine = parent.createChild('div', 'settings-line'); |
| 308 | headLine.createChild('div', 'settings-key-cell'); |
| 309 | headLine.createChild('div', 'settings-section-title settings-cell').textContent = this.name; |
Amanda Baker | 11630de | 2019-07-12 02:54:33 | [diff] [blame] | 310 | UI.ARIAUtils.markAsHeading(headLine, /* level */ 2); |
Blink Reformat | 4c46d09 | 2018-04-07 15:32:37 | [diff] [blame] | 311 | |
| 312 | for (let i = 0; i < this._lines.length; ++i) { |
| 313 | const line = parent.createChild('div', 'settings-line'); |
| 314 | const keyCell = line.createChild('div', 'settings-key-cell'); |
| 315 | keyCell.appendChild(this._lines[i].key); |
| 316 | keyCell.appendChild(this._createSpan('settings-key-delimiter', ':')); |
| 317 | line.createChild('div', 'settings-cell').textContent = this._lines[i].text; |
| 318 | } |
| 319 | } |
| 320 | |
| 321 | /** |
| 322 | * @param {!Array.<!UI.KeyboardShortcut.Descriptor>} sequence |
| 323 | * @param {string} delimiter |
| 324 | * @return {!Node} |
| 325 | */ |
| 326 | _renderSequence(sequence, delimiter) { |
| 327 | const delimiterSpan = this._createSpan('settings-key-delimiter', delimiter); |
| 328 | return this._joinNodes(sequence.map(this._renderKey.bind(this)), delimiterSpan); |
| 329 | } |
| 330 | |
| 331 | /** |
| 332 | * @param {!UI.KeyboardShortcut.Descriptor} key |
| 333 | * @return {!Node} |
| 334 | */ |
| 335 | _renderKey(key) { |
| 336 | const keyName = key.name; |
| 337 | const plus = this._createSpan('settings-combine-keys', '+'); |
| 338 | return this._joinNodes(keyName.split(' + ').map(this._createSpan.bind(this, 'settings-key')), plus); |
| 339 | } |
| 340 | |
| 341 | /** |
| 342 | * @param {string} className |
| 343 | * @param {string} textContent |
| 344 | * @return {!Element} |
| 345 | */ |
| 346 | _createSpan(className, textContent) { |
| 347 | const node = createElement('span'); |
| 348 | node.className = className; |
| 349 | node.textContent = textContent; |
| 350 | return node; |
| 351 | } |
| 352 | |
| 353 | /** |
| 354 | * @param {!Array.<!Element>} nodes |
| 355 | * @param {!Element} delimiter |
| 356 | * @return {!Node} |
| 357 | */ |
| 358 | _joinNodes(nodes, delimiter) { |
| 359 | const result = createDocumentFragment(); |
| 360 | for (let i = 0; i < nodes.length; ++i) { |
Tim van der Lippe | 1d6e57a | 2019-09-30 11:55:34 | [diff] [blame] | 361 | if (i > 0) { |
Blink Reformat | 4c46d09 | 2018-04-07 15:32:37 | [diff] [blame] | 362 | result.appendChild(delimiter.cloneNode(true)); |
Tim van der Lippe | 1d6e57a | 2019-09-30 11:55:34 | [diff] [blame] | 363 | } |
Blink Reformat | 4c46d09 | 2018-04-07 15:32:37 | [diff] [blame] | 364 | result.appendChild(nodes[i]); |
| 365 | } |
| 366 | return result; |
| 367 | } |
Tim van der Lippe | 0830b3d | 2019-10-03 13:20:07 | [diff] [blame] | 368 | } |
Blink Reformat | 4c46d09 | 2018-04-07 15:32:37 | [diff] [blame] | 369 | |
Tim van der Lippe | 0830b3d | 2019-10-03 13:20:07 | [diff] [blame] | 370 | ShortcutsSection._sequenceNumber = 0; |
Blink Reformat | 4c46d09 | 2018-04-07 15:32:37 | [diff] [blame] | 371 | |
| 372 | |
Tim van der Lippe | c96ccd9 | 2019-11-29 16:23:54 | [diff] [blame] | 373 | const ElementsPanelShortcuts = { |
Paul Lewis | 9950e18 | 2019-12-16 16:06:07 | [diff] [blame^] | 374 | NavigateUp: [KeyboardShortcut.makeDescriptor(Keys.Up)], |
Blink Reformat | 4c46d09 | 2018-04-07 15:32:37 | [diff] [blame] | 375 | |
Paul Lewis | 9950e18 | 2019-12-16 16:06:07 | [diff] [blame^] | 376 | NavigateDown: [KeyboardShortcut.makeDescriptor(Keys.Down)], |
Blink Reformat | 4c46d09 | 2018-04-07 15:32:37 | [diff] [blame] | 377 | |
Paul Lewis | 9950e18 | 2019-12-16 16:06:07 | [diff] [blame^] | 378 | Expand: [KeyboardShortcut.makeDescriptor(Keys.Right)], |
Blink Reformat | 4c46d09 | 2018-04-07 15:32:37 | [diff] [blame] | 379 | |
Paul Lewis | 9950e18 | 2019-12-16 16:06:07 | [diff] [blame^] | 380 | Collapse: [KeyboardShortcut.makeDescriptor(Keys.Left)], |
Blink Reformat | 4c46d09 | 2018-04-07 15:32:37 | [diff] [blame] | 381 | |
Paul Lewis | 9950e18 | 2019-12-16 16:06:07 | [diff] [blame^] | 382 | EditAttribute: [KeyboardShortcut.makeDescriptor(Keys.Enter)], |
Blink Reformat | 4c46d09 | 2018-04-07 15:32:37 | [diff] [blame] | 383 | |
Paul Lewis | 9950e18 | 2019-12-16 16:06:07 | [diff] [blame^] | 384 | NextProperty: [KeyboardShortcut.makeDescriptor(Keys.Tab)], |
Blink Reformat | 4c46d09 | 2018-04-07 15:32:37 | [diff] [blame] | 385 | |
Paul Lewis | 9950e18 | 2019-12-16 16:06:07 | [diff] [blame^] | 386 | PreviousProperty: [KeyboardShortcut.makeDescriptor(Keys.Tab, Modifiers.Shift)], |
Blink Reformat | 4c46d09 | 2018-04-07 15:32:37 | [diff] [blame] | 387 | |
Paul Lewis | 9950e18 | 2019-12-16 16:06:07 | [diff] [blame^] | 388 | IncrementValue: [KeyboardShortcut.makeDescriptor(Keys.Up)], |
Blink Reformat | 4c46d09 | 2018-04-07 15:32:37 | [diff] [blame] | 389 | |
Paul Lewis | 9950e18 | 2019-12-16 16:06:07 | [diff] [blame^] | 390 | DecrementValue: [KeyboardShortcut.makeDescriptor(Keys.Down)], |
Blink Reformat | 4c46d09 | 2018-04-07 15:32:37 | [diff] [blame] | 391 | |
Paul Lewis | 9950e18 | 2019-12-16 16:06:07 | [diff] [blame^] | 392 | IncrementBy10: |
| 393 | [KeyboardShortcut.makeDescriptor(Keys.PageUp), KeyboardShortcut.makeDescriptor(Keys.Up, Modifiers.Shift)], |
Blink Reformat | 4c46d09 | 2018-04-07 15:32:37 | [diff] [blame] | 394 | |
Paul Lewis | 9950e18 | 2019-12-16 16:06:07 | [diff] [blame^] | 395 | DecrementBy10: |
| 396 | [KeyboardShortcut.makeDescriptor(Keys.PageDown), KeyboardShortcut.makeDescriptor(Keys.Down, Modifiers.Shift)], |
Blink Reformat | 4c46d09 | 2018-04-07 15:32:37 | [diff] [blame] | 397 | |
Paul Lewis | 9950e18 | 2019-12-16 16:06:07 | [diff] [blame^] | 398 | IncrementBy100: [KeyboardShortcut.makeDescriptor(Keys.PageUp, Modifiers.Shift)], |
Blink Reformat | 4c46d09 | 2018-04-07 15:32:37 | [diff] [blame] | 399 | |
Paul Lewis | 9950e18 | 2019-12-16 16:06:07 | [diff] [blame^] | 400 | DecrementBy100: [KeyboardShortcut.makeDescriptor(Keys.PageDown, Modifiers.Shift)], |
Blink Reformat | 4c46d09 | 2018-04-07 15:32:37 | [diff] [blame] | 401 | |
Paul Lewis | 9950e18 | 2019-12-16 16:06:07 | [diff] [blame^] | 402 | IncrementBy01: [KeyboardShortcut.makeDescriptor(Keys.Up, Modifiers.Alt)], |
Blink Reformat | 4c46d09 | 2018-04-07 15:32:37 | [diff] [blame] | 403 | |
Paul Lewis | 9950e18 | 2019-12-16 16:06:07 | [diff] [blame^] | 404 | DecrementBy01: [KeyboardShortcut.makeDescriptor(Keys.Down, Modifiers.Alt)] |
Blink Reformat | 4c46d09 | 2018-04-07 15:32:37 | [diff] [blame] | 405 | }; |
| 406 | |
Tim van der Lippe | c96ccd9 | 2019-11-29 16:23:54 | [diff] [blame] | 407 | const ConsolePanelShortcuts = { |
Paul Lewis | 9950e18 | 2019-12-16 16:06:07 | [diff] [blame^] | 408 | AcceptSuggestion: [KeyboardShortcut.makeDescriptor(Keys.Tab), KeyboardShortcut.makeDescriptor(Keys.Right)], |
Fabio Rocha | f0d9547 | 2019-05-28 21:35:19 | [diff] [blame] | 409 | |
Paul Lewis | 9950e18 | 2019-12-16 16:06:07 | [diff] [blame^] | 410 | ClearConsolePrompt: [KeyboardShortcut.makeDescriptor('u', Modifiers.Ctrl)], |
Fabio Rocha | f0d9547 | 2019-05-28 21:35:19 | [diff] [blame] | 411 | |
Paul Lewis | 9950e18 | 2019-12-16 16:06:07 | [diff] [blame^] | 412 | ExecuteCommand: KeyboardShortcut.makeDescriptor(Keys.Enter), |
Fabio Rocha | f0d9547 | 2019-05-28 21:35:19 | [diff] [blame] | 413 | |
Paul Lewis | 9950e18 | 2019-12-16 16:06:07 | [diff] [blame^] | 414 | NextPreviousLine: [KeyboardShortcut.makeDescriptor(Keys.Down), KeyboardShortcut.makeDescriptor(Keys.Up)], |
Fabio Rocha | f0d9547 | 2019-05-28 21:35:19 | [diff] [blame] | 415 | |
Paul Lewis | 9950e18 | 2019-12-16 16:06:07 | [diff] [blame^] | 416 | NextPreviousCommand: |
| 417 | [KeyboardShortcut.makeDescriptor('N', Modifiers.Alt), KeyboardShortcut.makeDescriptor('P', Modifiers.Alt)], |
Fabio Rocha | f0d9547 | 2019-05-28 21:35:19 | [diff] [blame] | 418 | }; |
| 419 | |
Tim van der Lippe | 0830b3d | 2019-10-03 13:20:07 | [diff] [blame] | 420 | export const SourcesPanelShortcuts = { |
Paul Lewis | 9950e18 | 2019-12-16 16:06:07 | [diff] [blame^] | 421 | SelectNextOccurrence: [KeyboardShortcut.makeDescriptor('d', Modifiers.CtrlOrMeta)], |
Blink Reformat | 4c46d09 | 2018-04-07 15:32:37 | [diff] [blame] | 422 | |
Paul Lewis | 9950e18 | 2019-12-16 16:06:07 | [diff] [blame^] | 423 | SoftUndo: [KeyboardShortcut.makeDescriptor('u', Modifiers.CtrlOrMeta)], |
Blink Reformat | 4c46d09 | 2018-04-07 15:32:37 | [diff] [blame] | 424 | |
Paul Lewis | 9950e18 | 2019-12-16 16:06:07 | [diff] [blame^] | 425 | GotoMatchingBracket: [KeyboardShortcut.makeDescriptor('m', Modifiers.Ctrl)], |
Blink Reformat | 4c46d09 | 2018-04-07 15:32:37 | [diff] [blame] | 426 | |
Paul Lewis | 9950e18 | 2019-12-16 16:06:07 | [diff] [blame^] | 427 | ToggleAutocompletion: [KeyboardShortcut.makeDescriptor(Keys.Space, Modifiers.Ctrl)], |
Blink Reformat | 4c46d09 | 2018-04-07 15:32:37 | [diff] [blame] | 428 | |
Paul Lewis | 9950e18 | 2019-12-16 16:06:07 | [diff] [blame^] | 429 | IncreaseCSSUnitByOne: [KeyboardShortcut.makeDescriptor(Keys.Up, Modifiers.Alt)], |
Blink Reformat | 4c46d09 | 2018-04-07 15:32:37 | [diff] [blame] | 430 | |
Paul Lewis | 9950e18 | 2019-12-16 16:06:07 | [diff] [blame^] | 431 | DecreaseCSSUnitByOne: [KeyboardShortcut.makeDescriptor(Keys.Down, Modifiers.Alt)], |
Blink Reformat | 4c46d09 | 2018-04-07 15:32:37 | [diff] [blame] | 432 | |
Paul Lewis | 9950e18 | 2019-12-16 16:06:07 | [diff] [blame^] | 433 | IncreaseCSSUnitByTen: [KeyboardShortcut.makeDescriptor(Keys.PageUp, Modifiers.Alt)], |
Blink Reformat | 4c46d09 | 2018-04-07 15:32:37 | [diff] [blame] | 434 | |
Paul Lewis | 9950e18 | 2019-12-16 16:06:07 | [diff] [blame^] | 435 | DecreaseCSSUnitByTen: [KeyboardShortcut.makeDescriptor(Keys.PageDown, Modifiers.Alt)], |
| 436 | EvaluateSelectionInConsole: [KeyboardShortcut.makeDescriptor('e', Modifiers.Shift | Modifiers.Ctrl)], |
Blink Reformat | 4c46d09 | 2018-04-07 15:32:37 | [diff] [blame] | 437 | |
Paul Lewis | 9950e18 | 2019-12-16 16:06:07 | [diff] [blame^] | 438 | AddSelectionToWatch: [KeyboardShortcut.makeDescriptor('a', Modifiers.Shift | Modifiers.Ctrl)], |
Blink Reformat | 4c46d09 | 2018-04-07 15:32:37 | [diff] [blame] | 439 | |
Paul Lewis | 9950e18 | 2019-12-16 16:06:07 | [diff] [blame^] | 440 | ToggleComment: [KeyboardShortcut.makeDescriptor(Keys.Slash, Modifiers.CtrlOrMeta)], |
Blink Reformat | 4c46d09 | 2018-04-07 15:32:37 | [diff] [blame] | 441 | }; |
| 442 | |
Tim van der Lippe | 0830b3d | 2019-10-03 13:20:07 | [diff] [blame] | 443 | export const LayersPanelShortcuts = { |
Paul Lewis | 9950e18 | 2019-12-16 16:06:07 | [diff] [blame^] | 444 | ResetView: [KeyboardShortcut.makeDescriptor('0')], |
Blink Reformat | 4c46d09 | 2018-04-07 15:32:37 | [diff] [blame] | 445 | |
Paul Lewis | 9950e18 | 2019-12-16 16:06:07 | [diff] [blame^] | 446 | PanMode: [KeyboardShortcut.makeDescriptor('x')], |
Blink Reformat | 4c46d09 | 2018-04-07 15:32:37 | [diff] [blame] | 447 | |
Paul Lewis | 9950e18 | 2019-12-16 16:06:07 | [diff] [blame^] | 448 | RotateMode: [KeyboardShortcut.makeDescriptor('v')], |
Blink Reformat | 4c46d09 | 2018-04-07 15:32:37 | [diff] [blame] | 449 | |
Paul Lewis | 9950e18 | 2019-12-16 16:06:07 | [diff] [blame^] | 450 | TogglePanRotate: [KeyboardShortcut.makeDescriptor(Keys.Shift)], |
Blink Reformat | 4c46d09 | 2018-04-07 15:32:37 | [diff] [blame] | 451 | |
Paul Lewis | 9950e18 | 2019-12-16 16:06:07 | [diff] [blame^] | 452 | ZoomIn: |
| 453 | [KeyboardShortcut.makeDescriptor(Keys.Plus, Modifiers.Shift), KeyboardShortcut.makeDescriptor(Keys.NumpadPlus)], |
Blink Reformat | 4c46d09 | 2018-04-07 15:32:37 | [diff] [blame] | 454 | |
Paul Lewis | 9950e18 | 2019-12-16 16:06:07 | [diff] [blame^] | 455 | ZoomOut: |
| 456 | [KeyboardShortcut.makeDescriptor(Keys.Minus, Modifiers.Shift), KeyboardShortcut.makeDescriptor(Keys.NumpadMinus)], |
Blink Reformat | 4c46d09 | 2018-04-07 15:32:37 | [diff] [blame] | 457 | |
Paul Lewis | 9950e18 | 2019-12-16 16:06:07 | [diff] [blame^] | 458 | Up: [KeyboardShortcut.makeDescriptor(Keys.Up), KeyboardShortcut.makeDescriptor('w')], |
Blink Reformat | 4c46d09 | 2018-04-07 15:32:37 | [diff] [blame] | 459 | |
Paul Lewis | 9950e18 | 2019-12-16 16:06:07 | [diff] [blame^] | 460 | Down: [KeyboardShortcut.makeDescriptor(Keys.Down), KeyboardShortcut.makeDescriptor('s')], |
Blink Reformat | 4c46d09 | 2018-04-07 15:32:37 | [diff] [blame] | 461 | |
Paul Lewis | 9950e18 | 2019-12-16 16:06:07 | [diff] [blame^] | 462 | Left: [KeyboardShortcut.makeDescriptor(Keys.Left), KeyboardShortcut.makeDescriptor('a')], |
Blink Reformat | 4c46d09 | 2018-04-07 15:32:37 | [diff] [blame] | 463 | |
Paul Lewis | 9950e18 | 2019-12-16 16:06:07 | [diff] [blame^] | 464 | Right: [KeyboardShortcut.makeDescriptor(Keys.Right), KeyboardShortcut.makeDescriptor('d')] |
Blink Reformat | 4c46d09 | 2018-04-07 15:32:37 | [diff] [blame] | 465 | }; |