Wiki source code of XWiki Keyboard Shortcuts
Version 34.1 by Vincent Massol on 2020/04/12
Hide last authors
author | version | line-number | content |
---|---|---|---|
![]() |
12.4 | 1 | {{velocity}} |
2 | $xwiki.ssx.use("Features.KeyboardShortcuts") | ||
3 | {{/velocity}} | ||
![]() |
12.1 | 4 | |
![]() |
8.1 | 5 | {{box cssClass="floatinginfobox" title="**Contents**"}} |
6 | {{toc/}} | ||
7 | {{/box}} | ||
![]() |
1.1 | 8 | |
![]() |
31.2 | 9 | You can use keyboard shortcuts to use some XWiki features. Keyboard shortcuts help you save time since you never have to take your hands off the keyboard to use the mouse. |
![]() |
1.1 | 10 | |
![]() |
12.1 | 11 | = Using keyboard shortcuts = |
![]() |
1.1 | 12 | |
![]() |
12.1 | 13 | == View Mode == |
![]() |
1.1 | 14 | |
![]() |
8.1 | 15 | {{info}} |
16 | View keyboard shortcuts are only available to advanced users, preventing simple users to get unexpected behavior when pressing keyboard keys by mistake | ||
17 | {{/info}} | ||
![]() |
1.1 | 18 | |
![]() |
12.1 | 19 | === a) Edit Actions === |
![]() |
1.1 | 20 | |
![]() |
12.4 | 21 | (% class="keyboard" summary="Keyboard Shortcuts for View Mode in order to activate edit actions" %) |
![]() |
33.1 | 22 | |(% class="shortcut" %)((( |
![]() |
12.4 | 23 | (% class="key" %)E |
![]() |
13.2 | 24 | )))|Edit the page using the default edition mode |
![]() |
33.1 | 25 | |(% class="shortcut" %)((( |
![]() |
12.4 | 26 | (% class="key" %)K |
![]() |
13.2 | 27 | )))|Edit the page in wiki edition mode |
![]() |
33.1 | 28 | |(% class="shortcut" %)((( |
![]() |
12.4 | 29 | (% class="key" %)G |
![]() |
13.2 | 30 | )))|Edit the page using the WYSIWYG editor |
![]() |
33.1 | 31 | |(% class="shortcut" %)((( |
![]() |
12.4 | 32 | (% class="key" %)F |
![]() |
13.2 | 33 | )))|Inline Form |
![]() |
33.1 | 34 | |(% class="shortcut" %)((( |
![]() |
12.4 | 35 | (% class="key" %)R |
![]() |
13.2 | 36 | )))|Edit page access rights |
![]() |
33.1 | 37 | |(% class="shortcut" %)((( |
![]() |
12.4 | 38 | (% class="key" %)O |
![]() |
13.2 | 39 | )))|Edit page objects |
![]() |
33.1 | 40 | |(% class="shortcut" %)((( |
![]() |
12.4 | 41 | (% class="key" %)S |
![]() |
13.2 | 42 | )))|Edit class |
![]() |
1.1 | 43 | |
![]() |
12.1 | 44 | === b) View Actions === |
![]() |
1.1 | 45 | |
![]() |
12.4 | 46 | (% class="keyboard" summary="Keyboard Shortcuts for View Mode in order to activate view actions" %) |
![]() |
33.1 | 47 | |(% class="shortcut" %)((( |
![]() |
12.4 | 48 | (% class="key" %)C |
![]() |
13.2 | 49 | )))|Go to page comments |
![]() |
33.1 | 50 | |(% class="shortcut" %)((( |
![]() |
12.4 | 51 | (% class="key" %)A |
![]() |
13.2 | 52 | )))|Go to page attachments |
![]() |
33.1 | 53 | |(% class="shortcut" %)((( |
![]() |
12.4 | 54 | (% class="key" %)H |
![]() |
13.2 | 55 | )))|Go to page history |
![]() |
33.1 | 56 | |(% class="shortcut" %)((( |
![]() |
13.1 | 57 | (% class="key" %)I |
![]() |
13.2 | 58 | )))|Go to page information |
![]() |
33.1 | 59 | |(% class="shortcut" %)((( |
![]() |
12.4 | 60 | (% class="key" %)D |
![]() |
13.2 | 61 | )))|View page wiki code |
![]() |
1.1 | 62 | |
![]() |
12.1 | 63 | === c) Other Actions === |
![]() |
1.1 | 64 | |
![]() |
12.4 | 65 | (% class="keyboard" summary="Keyboard Shortcuts for View Mode in order to activate other actions" %) |
![]() |
33.1 | 66 | |(% class="shortcut" %)((( |
![]() |
12.4 | 67 | (% class="key" %)F2 |
![]() |
13.2 | 68 | )))|Rename page |
![]() |
33.1 | 69 | |(% class="shortcut" %)((( |
![]() |
12.4 | 70 | (% class="key" %)Delete |
![]() |
13.2 | 71 | )))|Delete page |
![]() |
1.1 | 72 | |
![]() |
12.1 | 73 | == Edit Wiki & Edit Inline Mode == |
![]() |
1.1 | 74 | |
![]() |
8.1 | 75 | {{warning}} |
![]() |
12.4 | 76 | While in Inline Edit mode and focusing on a WYSIWYG edit area, the keyboard shortcuts listed below won't work since the WYSIWYG editor grabs all the key pressed events. |
![]() |
8.1 | 77 | {{/warning}} |
78 | |||
![]() |
12.1 | 79 | (% class="keyboard" summary="Keyboard Shortcuts for Edit Wiki and Inline Mode" %) |
![]() |
33.1 | 80 | |(% class="shortcut" %)((( |
![]() |
12.4 | 81 | (% class="key" %)Alt(%%) + (% class="key" %)C |
82 | )))|Cancel edition | ||
![]() |
33.1 | 83 | |(% class="shortcut" %)((( |
![]() |
12.4 | 84 | (% class="key" %)Alt(%%) + (% class="key" %)P |
85 | )))|Preview the page without saving | ||
![]() |
33.1 | 86 | |(% class="shortcut" %)((( |
![]() |
12.4 | 87 | (% class="key" %)Alt(%%) + (% class="key" %)Shift(%%) + (% class="key" %)S |
88 | )))|Save and continue to edit the page | ||
![]() |
33.1 | 89 | |(% class="shortcut" %)((( |
![]() |
12.4 | 90 | (% class="key" %)Alt(%%) + (% class="key" %)S |
91 | )))|Save and view the page | ||
![]() |
1.1 | 92 | |
![]() |
12.1 | 93 | == Edit WYSIWYG Mode == |
![]() |
1.1 | 94 | |
![]() |
33.1 | 95 | {{include document="Documentation.UserGuide.Features.WysiwygEditorShortcuts"/}} |
![]() |
1.1 | 96 | |
![]() |
12.1 | 97 | == Preview Mode == |
98 | |||
99 | (% class="keyboard" summary="Keyboard Shortcuts for Preview Mode" %) | ||
![]() |
33.1 | 100 | |(% class="shortcut" %)((( |
![]() |
12.4 | 101 | (% class="key" %)Alt(%%) + (% class="key" %)C |
![]() |
13.2 | 102 | )))|Cancel edition |
![]() |
33.1 | 103 | |(% class="shortcut" %)((( |
![]() |
12.4 | 104 | (% class="key" %)Alt(%%) + (% class="key" %)B |
![]() |
13.2 | 105 | )))|Back to the edition |
![]() |
33.1 | 106 | |(% class="shortcut" %)((( |
![]() |
12.4 | 107 | (% class="key" %)Alt(%%) + (% class="key" %)Shift(%%) + (% class="key" %)S |
![]() |
13.2 | 108 | )))|Save and continue to edit the page |
![]() |
33.1 | 109 | |(% class="shortcut" %)((( |
![]() |
12.4 | 110 | (% class="key" %)Alt(%%) + (% class="key" %)S |
![]() |
13.2 | 111 | )))|Save and view the page |
![]() |
12.1 | 112 | |
![]() |
11.1 | 113 | == Annotations == |
114 | |||
![]() |
12.1 | 115 | (% class="keyboard" summary="Keyboard Shortcuts for Annotations" %) |
![]() |
33.1 | 116 | |(% class="shortcut" %)((( |
![]() |
13.3 | 117 | (% class="key" %)Ctrl(%%) + (% class="key" %)M(%%) (% class="separator" %)or(%%) (% class="key" %)Meta(%%) + (% class="key" %)M(%%) |
118 | (% class="key" %)Ctrl(%%) + (% class="key" %)I(%%) (% class="separator" %)or(%%) (% class="key" %)Meta(%%) + (% class="key" %)I | ||
![]() |
13.2 | 119 | )))|Annotate a piece of text |
![]() |
33.1 | 120 | |(% class="shortcut" %)((( |
![]() |
29.3 | 121 | (% class="key" %)Alt(%%) + (% class="key" %)A |
122 | )))|Show annotations | ||
![]() |
11.1 | 123 | |
![]() |
12.1 | 124 | == Navigation == |
![]() |
7.1 | 125 | |
![]() |
12.1 | 126 | (% class="keyboard" summary="Keyboard Shortcuts for Navigation" %) |
![]() |
32.2 | 127 | |((( |
128 | (% class="shortcut" %) | ||
![]() |
12.4 | 129 | ((( |
130 | (% class="key" %)Ctrl(%%) + (% class="key" %)G | ||
![]() |
33.1 | 131 | ))) |
![]() |
32.2 | 132 | |
![]() |
33.1 | 133 | (% class="separator" %)or |
134 | |||
![]() |
32.2 | 135 | (% class="shortcut" %) |
![]() |
12.4 | 136 | ((( |
137 | (% class="key" %)Meta(%%) + (% class="key" %)G | ||
![]() |
32.2 | 138 | ))) |
![]() |
12.4 | 139 | )))|Jump to any page in the wiki |
![]() |
12.1 | 140 | |
![]() |
24.1 | 141 | == Developer shortcuts == |
142 | |||
![]() |
26.1 | 143 | {{info}}Since 9.11{{/info}}, the following key sequences can be used to toggle specific actions on the current logged in user: |
![]() |
24.1 | 144 | |
145 | (% class="keyboard" summary="Keyboard Shortcuts for developers" %) | ||
![]() |
33.1 | 146 | |(% class="shortcut" %)((( |
![]() |
24.1 | 147 | (% class="key" %)x(%%) (% class="key" %)x(%%) (% class="key" %)x(%%) (% class="key" %)a |
148 | )))|Toggle advanced user mode for the current user. | ||
149 | |||
150 | (% class="keyboard" summary="Keyboard Shortcuts for developers" %) | ||
![]() |
33.1 | 151 | |(% class="shortcut" %)((( |
![]() |
24.1 | 152 | (% class="key" %)x(%%) (% class="key" %)x(%%) (% class="key" %)x(%%) (% class="key" %)h |
153 | )))|Toggle hidden pages for the current user. | ||
154 | |||
![]() |
12.1 | 155 | = Configuring keyboard shortcuts = |
156 | |||
157 | == Modifying keyboard shortcuts == | ||
158 | |||
![]() |
29.2 | 159 | * Create a new page in your wiki, for example ##XWiki.KeyboardShortcuts## and paste the following content inside:((( |
![]() |
12.4 | 160 | {{code}} |
161 | core.shortcuts.view.edit=e | ||
![]() |
7.1 | 162 | core.shortcuts.view.wiki=k |
163 | core.shortcuts.view.wysiwyg=g | ||
164 | core.shortcuts.view.inline=f | ||
165 | core.shortcuts.view.rights=r | ||
166 | core.shortcuts.view.objects=o | ||
167 | core.shortcuts.view.class=s | ||
168 | core.shortcuts.view.comments=c | ||
169 | core.shortcuts.view.attachments=a | ||
170 | core.shortcuts.view.history=h | ||
171 | core.shortcuts.view.information=i | ||
172 | core.shortcuts.view.code=d | ||
![]() |
21.2 | 173 | core.shortcuts.view.delete=Delete |
174 | core.shortcuts.view.rename=F2 | ||
175 | core.shortcuts.edit.cancel=Alt+C | ||
176 | core.shortcuts.edit.backtoedit=Alt+B | ||
177 | core.shortcuts.edit.preview=Alt+P | ||
178 | core.shortcuts.edit.saveandcontinue=Alt+Shift+S | ||
179 | core.shortcuts.edit.saveandview=Alt+S | ||
![]() |
12.4 | 180 | {{/code}} |
181 | ))) | ||
![]() |
7.1 | 182 | * Modify entries in this list at your convenience |
183 | * Save the page | ||
![]() |
34.1 | 184 | * Edit the page in [[object mode>>Documentation.UserGuide.Features.PageEditing#HObjectseditingmode]] and add an ## XWiki.TranslationDocumentClass## xobject |
185 | ** Select the ##wiki## scope for the new translations (i.e. the new keyboard shortcuts) to apply to the whole wiki. {{warning}}You'll need to have Admin permissions for it to work{{/warning}} | ||
![]() |
7.1 | 186 | |
![]() |
12.1 | 187 | == Adding your own shortcuts == |
![]() |
1.1 | 188 | |
189 | You can add your own keyboard shortcuts in a few javascript lines : | ||
190 | |||
![]() |
8.1 | 191 | {{code language="html"}} |
![]() |
1.1 | 192 | <script type="text/javascript"> |
193 | //<![CDATA[ | ||
![]() |
23.1 | 194 | shortcut.add("Ctrl+Alt+n", function() { alert("Hey there! Congratulations on typing this one ;)"); }); |
![]() |
1.1 | 195 | //]]> |
196 | </script> | ||
![]() |
2.1 | 197 | {{/code}} |
![]() |
1.1 | 198 | |
![]() |
6.1 | 199 | {{html clean="false"}} |
![]() |
1.1 | 200 | <script type="text/javascript"> |
![]() |
23.1 | 201 | shortcut.add("Ctrl+Alt+n", function() { alert("Hey there! Congratulations on typing this one ;)"); }, {'propagate':false} ); |
![]() |
1.1 | 202 | </script> |
![]() |
5.1 | 203 | {{/html}} |
204 | |||
![]() |
12.4 | 205 | Try the snippet by pressing (% class="key" %)**Ctrl**(%%) + (% class="key" %)**Alt**(%%) + (% class="key" %)**n**(%%). |
![]() |
5.1 | 206 | |
![]() |
24.1 | 207 | Also check the [[complete documentation>>https://dmauro.github.io/Keypress/]]. |
![]() |
1.1 | 208 | |
![]() |
12.1 | 209 | == Removing keyboard shortcuts == |
![]() |
1.1 | 210 | |
![]() |
32.1 | 211 | To remove a shortcut adapt the following snippet to your needs and use by putting it in a [[JavaScript StyleSheet Extension>>Documentation.DevGuide.Tutorials.SkinExtensionsTutorial.WebHome]]: |
![]() |
1.1 | 212 | |
![]() |
32.2 | 213 | {{code language="javascript"}} |
![]() |
32.1 | 214 | shortcut.remove("Ctrl+Alt+n"); |
![]() |
2.1 | 215 | {{/code}} |
![]() |
1.1 | 216 | |
![]() |
12.1 | 217 | == Removing all shortcuts at once == |
![]() |
5.1 | 218 | |
![]() |
32.2 | 219 | {{code language="javascript"}} |
![]() |
32.1 | 220 | for (binding in shortcut.all_shortcuts()) { |
221 | shortcut.remove(binding.keys.join(' ')); | ||
222 | } | ||
![]() |
5.1 | 223 | {{/code}} |
224 | |||
![]() |
12.1 | 225 | == Credits == |
![]() |
1.1 | 226 | |
![]() |
24.1 | 227 | XWiki keyboard shortcuts are powered by [[Keypress JS shortcut library>>https://dmauro.github.io/Keypress/]]. |