Jump to content

Hot Key Search

Robin S

Recommended Posts

My first module release. :)

GitHub: https://github.com/Toutouwai/HotkeySearch

ProcessWire module that adds configurable hot keys for easier use of the admin search via the keyboard. Uses Mousetrap for key bindings.

Module provides two hot key bindings:

  • Jump to and focus admin search input. Also handy for quickly getting to the admin menu tabs when they have scrolled outside the viewport. If you change your mind, tab out of the search input and press the hot key again and the viewport will jump back to your previous scroll position. Uses 's' key by default.
  • Trigger link for focused search result. If you use the arrow keys to highlight a search result this hot key allows you to trigger the link from the keyboard. Uses 'enter' key by default.

The hot keys are configurable in the module settings. Hot keys only fire when you are not inside an input, textarea or select.

This module is only intended for use with the default admin theme. Admin Theme Reno already binds the up arrow key for closing the search input and doesn't show a visual highlight for search results focused via the keyboard so the module would be less useful there.

Much credit goes to Soma's AdminHotKeys module.


As an aside, I'm don't know if the admin search was meant to allow result links to be triggered with the enter key by default. I noticed a Javascript error when focusing search results but not sure if that's to blame.

  • Like 4
Link to comment
Share on other sites

v0.0.2 - follows better module naming conventions.


I've become aware of an issue when using the hot keys in Page Edit where the page has unsaved changes. On hitting enter on a selected search result the unsaved changes popup is bypassed - not by the selected result URL but by the fallback behaviour of the search box itself, which navigates to "/page/search/?q=..."

Am trying to find a solution to this. Any suggestions welcome.

Fixed now in v0.0.3

  • Like 2
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Create New...