XWiki Keyboard Shortcuts

Since XWiki Enterprise version 1.4M1, 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. 

Shortcuts

View mode

View keyboard shortcuts are only available to advanced users, preventing simple users to get unexpected behavior when pressing keyboard keys by mistake

Edit

e Edit the page using the default edition mode
k Edit the page in wiki edition mode
g Edit the page using the WYSIWYG editor
f Inline Form
r Edit page access rights
o Edit page objects
s Edit class

Show

c Go to page comments
a Go to page attachments
h Go to page history
d View page wiki code

Actions

F2 Rename page
Delete Delete page

Edit & inline mode

Keyboard shortcuts aren't available from the wysiwyg edit mode (since the wysiwyg editor grabs all the key pressed events)

<Alt> + c Cancel edition
<Alt> + p Preview the page without saving
<Alt> + <Shift> + s Save and continue to edit the page
<Alt> + s Save and view the page

Preview mode

<Alt> + c Cancel edition
<Alt> + b Back to the edition
<Alt> + <Shift> + s Save and continue to edit the page
<Alt> + s Save and view the page

Adding your own shortcuts

You can add your own keyboard shortcuts in a few javascript lines :

<script type="text/javascript">
//<![CDATA[
 shortcut.add("Ctrl+Alt+n", function() { alert("Hey there! Congratulations on typing this one ;)"); });
//]]>
</script>

Try the snippet by pressing Ctrl+Alt+n. 

Complete documentation.

Removing shortcuts

To remove a shortcut adapt this snippet to your needs :

<script type="text/javascript">
//<![CDATA[
 shortcut.remove("Ctrl+Alt+n");
//]]>
</script>
Click here to try the snippet, it will remove the Ctrl+Alt+n shortcut.

Removing all shortcuts at once

<script type="text/javascript">
//<![CDATA[
 for (binding in shortcut.all_shortcuts) {
    shortcut.remove(binding);
  }
//]]>
</script>
Failed to execute the [velocity] macro. Cause: [Nested scripts are not allowed. Current Script Macro [velocity] (source [xwiki:Documentation.UserGuide.Features.KeyboardShortcuts]) is executed inside Script Macro [velocity] (source [xwiki:Documentation.UserGuide.Features.KeyboardShortcuts])]. Click on this message for details.
Tags:
   

Get Connected