Wiki source code of XWiki Keyboard Shortcuts

Last modified by Lucas Charpentier (Sereza7) on 2024/02/27

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 === 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 === 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" %)N
52 )))|Go to page annotations {{warning}} This shortcut might be used for creating a new page instead. See the evolution of the discussion on [[this forum topic>>https://forum.xwiki.org/t/adding-a-shortcut-for-the-create-action/]]{{/warning}}
53 |(% class="shortcut" %)(((
54 (% class="key" %)A
55 )))|Go to page attachments
56 |(% class="shortcut" %)(((
57 (% class="key" %)H
58 )))|Go to page history
59 |(% class="shortcut" %)(((
60 (% class="key" %)I
61 )))|Go to page information
62 |(% class="shortcut" %)(((
63 (% class="key" %)D
64 )))|View page wiki code
65
66 === Other Actions ===
67
68 (% class="keyboard" summary="Keyboard Shortcuts for View Mode in order to activate other actions" %)
69 |(% class="shortcut" %)(((
70 (% class="key" %)F2
71 )))|Rename page
72 |(% class="shortcut" %)(((
73 (% class="key" %)Delete
74 )))|Delete page
75
76 == Edit Mode ==
77
78 (% class="keyboard" summary="Keyboard Shortcuts for Edit Mode" %)
79 |(% class="shortcut" %)(((
80 (% class="key" %)Alt(%%) + (% class="key" %)C
81 )))|Cancel edition
82 |(% class="shortcut" %)(((
83 (% class="key" %)Alt(%%) + (% class="key" %)P
84 )))|Preview the page without saving
85 |(% class="shortcut" %)(((
86 (% class="key" %)Alt(%%) + (% class="key" %)Shift(%%) + (% class="key" %)S
87 )))|Save and continue to edit the page
88 |(% class="shortcut" %)(((
89 (% class="key" %)Alt(%%) + (% class="key" %)S
90 )))|Save and view the page
91
92 === WYSIWYG Edit Mode ===
93
94 See the [[WYSIWYG Editor keyboard shortcuts>>extensions:Extension.CKEditor Integration#HKeyboardShortcuts]].
95
96 == Preview Mode ==
97
98 (% class="keyboard" summary="Keyboard Shortcuts for Preview Mode" %)
99 |(% class="shortcut" %)(((
100 (% class="key" %)Alt(%%) + (% class="key" %)C
101 )))|Cancel edition
102 |(% class="shortcut" %)(((
103 (% class="key" %)Alt(%%) + (% class="key" %)B
104 )))|Back to the edition
105 |(% class="shortcut" %)(((
106 (% class="key" %)Alt(%%) + (% class="key" %)Shift(%%) + (% class="key" %)S
107 )))|Save and continue to edit the page
108 |(% class="shortcut" %)(((
109 (% class="key" %)Alt(%%) + (% class="key" %)S
110 )))|Save and view the page
111
112 == Annotations ==
113
114 (% class="keyboard" summary="Keyboard Shortcuts for Annotations" %)
115 |(% class="shortcut" %)(((
116 (% class="key" %)Ctrl(%%) + (% class="key" %)M(%%) (% class="separator" %)or(%%) (% class="key" %)Meta(%%) + (% class="key" %)M(%%)
117 (% class="key" %)Ctrl(%%) + (% class="key" %)I(%%) (% class="separator" %)or(%%) (% class="key" %)Meta(%%) + (% class="key" %)I
118 )))|Annotate a piece of text
119 |(% class="shortcut" %)(((
120 (% class="key" %)Alt(%%) + (% class="key" %)A
121 )))|Show annotations
122
123 == Navigation ==
124
125 (% class="keyboard" summary="Keyboard Shortcuts for Navigation" %)
126 |(% class="shortcut" %)(((
127 (% class="key" %)Ctrl(%%) + (% class="key" %)G(%%) (% class="separator" %)or(%%) (% class="key" %)Meta(%%) + (% class="key" %)G(%%)
128 (% class="key" %)Ctrl(%%) + (% class="key" %)/(%%) (% class="separator" %)or(%%) (% class="key" %)Meta(%%) + (% class="key" %)/(%%)
129 )))|Jump to any page in the wiki
130
131 == Developer shortcuts ==
132
133 {{info}}Since 9.11{{/info}}, the following key sequences can be used to toggle specific actions on the current logged in user:
134
135 (% class="keyboard" summary="Keyboard Shortcuts for developers" %)
136 |(% class="shortcut" %)(((
137 (% class="key" %)x(%%) (% class="key" %)x(%%) (% class="key" %)x(%%) (% class="key" %)a
138 )))|Toggle advanced user mode for the current user.
139
140 (% class="keyboard" summary="Keyboard Shortcuts for developers" %)
141 |(% class="shortcut" %)(((
142 (% class="key" %)x(%%) (% class="key" %)x(%%) (% class="key" %)x(%%) (% class="key" %)h
143 )))|Toggle hidden pages for the current user.
144
145 = Configuring keyboard shortcuts =
146
147 == Modifying keyboard shortcuts ==
148
149 * Create a new page in your wiki, for example ##XWiki.KeyboardShortcuts## and paste the following content inside:(((
150 {{code language="text"}}
151 core.shortcuts.view.edit=e
152 core.shortcuts.view.wiki=k
153 core.shortcuts.view.wysiwyg=g
154 core.shortcuts.view.inline=f
155 core.shortcuts.view.rights=r
156 core.shortcuts.view.objects=o
157 core.shortcuts.view.class=s
158 core.shortcuts.view.comments=c
159 core.shortcuts.view.attachments=a
160 core.shortcuts.view.history=h
161 core.shortcuts.view.information=i
162 core.shortcuts.view.code=d
163 core.shortcuts.view.delete=Delete
164 core.shortcuts.view.rename=F2
165 core.shortcuts.edit.cancel=Alt+C
166 core.shortcuts.edit.backtoedit=Alt+B
167 core.shortcuts.edit.preview=Alt+P
168 core.shortcuts.edit.saveandcontinue=Alt+Shift+S
169 core.shortcuts.edit.saveandview=Alt+S
170 {{/code}}
171 )))
172 * Modify entries in this list at your convenience
173 * Save the page
174 * Edit the page in [[object mode>>Documentation.UserGuide.Features.PageEditing#HObjectseditingmode]] and add an ## XWiki.TranslationDocumentClass## xobject
175 ** 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}}
176
177 == Adding your own shortcuts ==
178
179 You can add your own keyboard shortcuts in a few javascript lines. You can do that, for example, by adding a [[JavaScript StyleSheet Extension>>Documentation.DevGuide.Tutorials.SkinExtensionsTutorial.WebHome]] and putting the following content:
180
181 {{code language="javascript"}}
182 shortcut.add("Ctrl+Alt+n", function() { alert("Hey there! Congratulations on typing this one ;)"); });
183 {{/code}}
184
185 Also check the [[complete documentation>>https://dmauro.github.io/Keypress/]].
186
187 == Removing keyboard shortcuts ==
188
189 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]]:
190
191 {{code language="javascript"}}
192 shortcut.remove("Ctrl+Alt+n");
193 {{/code}}
194
195 == Removing all shortcuts at once ==
196
197 {{code language="javascript"}}
198 for (binding in shortcut.all_shortcuts()) {
199 shortcut.remove(binding.keys.join(' '));
200 }
201 {{/code}}
202
203 == Credits ==
204
205 XWiki keyboard shortcuts are powered by [[Keypress JS shortcut library>>https://dmauro.github.io/Keypress/]].

Get Connected