Wiki source code of XWiki Keyboard Shortcuts

Version 33.1 by Vincent Massol on 2020/04/05

Show last authors
1 {{velocity}}
2 $xwiki.ssx.use("Features.KeyboardShortcuts")
3 {{/velocity}}
4
5 {{box cssClass="floatinginfobox" title="**Contents**"}}
6 {{toc/}}
7 {{/box}}
8
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.
10
11 = Using keyboard shortcuts =
12
13 == View Mode ==
14
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}}
18
19 === a) Edit Actions ===
20
21 (% class="keyboard" summary="Keyboard Shortcuts for View Mode in order to activate edit actions" %)
22 |(% class="shortcut" %)(((
23 (% class="key" %)E
24 )))|Edit the page using the default edition mode
25 |(% class="shortcut" %)(((
26 (% class="key" %)K
27 )))|Edit the page in wiki edition mode
28 |(% class="shortcut" %)(((
29 (% class="key" %)G
30 )))|Edit the page using the WYSIWYG editor
31 |(% class="shortcut" %)(((
32 (% class="key" %)F
33 )))|Inline Form
34 |(% class="shortcut" %)(((
35 (% class="key" %)R
36 )))|Edit page access rights
37 |(% class="shortcut" %)(((
38 (% class="key" %)O
39 )))|Edit page objects
40 |(% class="shortcut" %)(((
41 (% class="key" %)S
42 )))|Edit class
43
44 === b) View Actions ===
45
46 (% class="keyboard" summary="Keyboard Shortcuts for View Mode in order to activate view actions" %)
47 |(% class="shortcut" %)(((
48 (% class="key" %)C
49 )))|Go to page comments
50 |(% class="shortcut" %)(((
51 (% class="key" %)A
52 )))|Go to page attachments
53 |(% class="shortcut" %)(((
54 (% class="key" %)H
55 )))|Go to page history
56 |(% class="shortcut" %)(((
57 (% class="key" %)I
58 )))|Go to page information
59 |(% class="shortcut" %)(((
60 (% class="key" %)D
61 )))|View page wiki code
62
63 === c) Other Actions ===
64
65 (% class="keyboard" summary="Keyboard Shortcuts for View Mode in order to activate other actions" %)
66 |(% class="shortcut" %)(((
67 (% class="key" %)F2
68 )))|Rename page
69 |(% class="shortcut" %)(((
70 (% class="key" %)Delete
71 )))|Delete page
72
73 == Edit Wiki & Edit Inline Mode ==
74
75 {{warning}}
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.
77 {{/warning}}
78
79 (% class="keyboard" summary="Keyboard Shortcuts for Edit Wiki and Inline Mode" %)
80 |(% class="shortcut" %)(((
81 (% class="key" %)Alt(%%) + (% class="key" %)C
82 )))|Cancel edition
83 |(% class="shortcut" %)(((
84 (% class="key" %)Alt(%%) + (% class="key" %)P
85 )))|Preview the page without saving
86 |(% class="shortcut" %)(((
87 (% class="key" %)Alt(%%) + (% class="key" %)Shift(%%) + (% class="key" %)S
88 )))|Save and continue to edit the page
89 |(% class="shortcut" %)(((
90 (% class="key" %)Alt(%%) + (% class="key" %)S
91 )))|Save and view the page
92
93 == Edit WYSIWYG Mode ==
94
95 {{include document="Documentation.UserGuide.Features.WysiwygEditorShortcuts"/}}
96
97 == Preview Mode ==
98
99 (% class="keyboard" summary="Keyboard Shortcuts for Preview Mode" %)
100 |(% class="shortcut" %)(((
101 (% class="key" %)Alt(%%) + (% class="key" %)C
102 )))|Cancel edition
103 |(% class="shortcut" %)(((
104 (% class="key" %)Alt(%%) + (% class="key" %)B
105 )))|Back to the edition
106 |(% class="shortcut" %)(((
107 (% class="key" %)Alt(%%) + (% class="key" %)Shift(%%) + (% class="key" %)S
108 )))|Save and continue to edit the page
109 |(% class="shortcut" %)(((
110 (% class="key" %)Alt(%%) + (% class="key" %)S
111 )))|Save and view the page
112
113 == Annotations ==
114
115 (% class="keyboard" summary="Keyboard Shortcuts for Annotations" %)
116 |(% class="shortcut" %)(((
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
119 )))|Annotate a piece of text
120 |(% class="shortcut" %)(((
121 (% class="key" %)Alt(%%) + (% class="key" %)A
122 )))|Show annotations
123
124 == Navigation ==
125
126 (% class="keyboard" summary="Keyboard Shortcuts for Navigation" %)
127 |(((
128 (% class="shortcut" %)
129 (((
130 (% class="key" %)Ctrl(%%) + (% class="key" %)G
131 )))
132
133 (% class="separator" %)or
134
135 (% class="shortcut" %)
136 (((
137 (% class="key" %)Meta(%%) + (% class="key" %)G
138 )))
139 )))|Jump to any page in the wiki
140
141 == Developer shortcuts ==
142
143 {{info}}Since 9.11{{/info}}, the following key sequences can be used to toggle specific actions on the current logged in user:
144
145 (% class="keyboard" summary="Keyboard Shortcuts for developers" %)
146 |(% class="shortcut" %)(((
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" %)
151 |(% class="shortcut" %)(((
152 (% class="key" %)x(%%) (% class="key" %)x(%%) (% class="key" %)x(%%) (% class="key" %)h
153 )))|Toggle hidden pages for the current user.
154
155 = Configuring keyboard shortcuts =
156
157 == Modifying keyboard shortcuts ==
158
159 * Create a new page in your wiki, for example ##XWiki.KeyboardShortcuts## and paste the following content inside:(((
160 {{code}}
161 core.shortcuts.view.edit=e
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
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
180 {{/code}}
181 )))
182 * Modify entries in this list at your convenience
183 * Save the page
184 * Go to the wiki administration, edit the attached XObject (change the URL to ##/edit/XWiki/XWikiPreferences?editor=object##)
185 * Add ##XWiki.KeyboardShortcuts## to the "Internationalization Document Bundles" field
186
187 == Adding your own shortcuts ==
188
189 You can add your own keyboard shortcuts in a few javascript lines :
190
191 {{code language="html"}}
192 <script type="text/javascript">
193 //<![CDATA[
194 shortcut.add("Ctrl+Alt+n", function() { alert("Hey there! Congratulations on typing this one ;)"); });
195 //]]>
196 </script>
197 {{/code}}
198
199 {{html clean="false"}}
200 <script type="text/javascript">
201 shortcut.add("Ctrl+Alt+n", function() { alert("Hey there! Congratulations on typing this one ;)"); }, {'propagate':false} );
202 </script>
203 {{/html}}
204
205 Try the snippet by pressing (% class="key" %)**Ctrl**(%%) + (% class="key" %)**Alt**(%%) + (% class="key" %)**n**(%%).
206
207 Also check the [[complete documentation>>https://dmauro.github.io/Keypress/]].
208
209 == Removing keyboard shortcuts ==
210
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]]:
212
213 {{code language="javascript"}}
214 shortcut.remove("Ctrl+Alt+n");
215 {{/code}}
216
217 == Removing all shortcuts at once ==
218
219 {{code language="javascript"}}
220 for (binding in shortcut.all_shortcuts()) {
221 shortcut.remove(binding.keys.join(' '));
222 }
223 {{/code}}
224
225 == Credits ==
226
227 XWiki keyboard shortcuts are powered by [[Keypress JS shortcut library>>https://dmauro.github.io/Keypress/]].

Get Connected