Plugins

Shortcuts

A simple library for handling keyboard shortcuts in Javascript.

Requirements

<script src="js/vendor/mousetrap.min.js"></script>

Example

Javascript
// Shows search modal when s key is pressed                      
Mousetrap.bind('s', function () {
  const searchModal = new bootstrap.Modal(document.getElementById('searchPagesModal'));
  searchModal.show();
});

More Examples

You may find more examples in Interface.Plugins.Shortcuts.html file which is initialized by js/plugins/shortcuts.js.

Documentation