I am not really a coder at all, but I am a huge fan of Admin2 (+Rubik). I am not sure how hard something like this would be to do, but is there a way to add a keyboard shortcut for admin? I use F12 to get into Firebug and would love to assign a shortcut to Admin to expand the menu. Again, this may be totally not possible, but thought I would ask.

This is an awesome module, thanks for all the hard work.

CommentFileSizeAuthor
#6 admin-hotkey-728832-6.patch12.04 KBmuhleder
#2 admin-hotkey.patch20.12 KBronan
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

yhahn’s picture

Title: the F12 of Admin - *Feature Request* » Feature request: Keybindings
Version: 6.x-2.0-alpha5 » 6.x-2.x-dev

Switching versions.

ronan’s picture

Status: Active » Needs review
FileSize
20.12 KB

Here's a patch that adds basic keybindings to the admin toolbar. It uses the jquery.hotkeys plugin http://code.google.com/p/js-hotkeys/ which is added in this patch.

The patch creates a hotkey to activate the toolbar (alt/ctrl-space by default) and allows you to navigate the various tabs and menu items with the tab key (to switch tabs) and arrow keys (to navigate the menu trees) and the return key to activate.

It's pretty basic, it only deals with the basic menus (you can't switch users, or activate the devel 'Other tools' for example) but it works. Also, there's no automatic scrolling of lists that overflow (so if you key down to a link past the bottom of the visible area you can't see it). Tested in Safari 4 (mac), Firefox 3.6 (mac) and IE 6/7/8.

Let me know what you think.

ronan’s picture

Oh, another point. If the page loads with the toolbar already active the key control is not active (because that would override users' tab and arrow keys unexpectedly) so in this case the first use of the hotkey activates the key control rather than toggling the toolbar. This is not necessarily obvious when you first use the module so some sort of visual feedback to indicate that the keyboard control has been activated might be useful. I'm probably not the best person to determine what that feedback should be though.

RockSoup’s picture

Awesome!

sepla’s picture

I second this.

muhleder’s picture

Version: 6.x-2.x-dev » 7.x-2.0-beta3
FileSize
12.04 KB

I'd also love to see this.

Here's a patch against 7.x-2.0-beta3

Only change from the D6 patch is updating the jquery hotkeys library.

mgifford’s picture

Issue tags: +Accessibility

Interesting. There are some real advantages to adding this, but also risks.

The link in the code should go to:
https://github.com/tzuryby/jquery.hotkeys

The link in the patch is broken.

I've asked a question about making this user configurable:
https://github.com/tzuryby/jquery.hotkeys/issues/14

There's also a discussion about the general issue from an accessibility point of view here:
http://drupal.org/node/23628

This would be very good if it were user configurable.

muhleder’s picture

I think this should be user configurable, I'm seeing a checkbox 'Enable Keyboard Control' at
/admin/config/user-interface/admin
(D7 version)

The 6.x version does include the jquery.hotkeys.js library which contains outdated links. My thoughts are that the library should be installed in /sites/all/libraries.

The jresig version of the library seems to work with Drupal 7.

muhleder’s picture

Also might be worth looking at https://github.com/madrobby/keymaster instead of the jquery dependendent hotkeys library. We have jquery with Drupal of course, but it makes us dependent upon jquery version.

mgifford’s picture

I couldn't get keymaster to work in the test environment. Not sure if it's how I've got FF configured or what.

From the docs it's not clear that there can be user defined pages or links. It looked really good, but I'm not sure how it will work with this particular request.

It looks very interesting though...