Re: Give a menu keyboard focus – in code
Re: Give a menu keyboard focus – in code
- Subject: Re: Give a menu keyboard focus – in code
- From: Andy Lee <email@hidden>
- Date: Mon, 10 Oct 2011 05:57:01 -0400
On Oct 10, 2011, at 2:02 AM, Jerry Krinock wrote:
> On 2011 Oct 09, at 22:26, John Joyce wrote:
>
>> For this reason, any menu item with a name can be assigned a keyboard shortcut in OS X System Preferences by the user.
>
> Thank you, John, but it doesn't work for Status Items; not for me.
[...]
> Actually, even if it did work, that's not what I want. Because my status item's menu is populated dynamically, I want users to be able to navigate through it with the arrow keys, like I can do with the Apple Status Items after hitting the F8 key.
Accessorizer's "Action Menu" is a status item that provides the exact UI Jerry is talking about, and I think it is brilliant. Not only can you use arrow keys to navigate the menu once you've popped it up, but in Accessorizer there are a couple dozen menu items, all with keyboard shortcuts, and with this UI:
* You don't have to memorize all those shortcuts (although eventually you will remember the ones you use most frequently). All you have to remember is Accessorizer's one shortcut to pop up the menu, and the menu items within the menu display their shortcuts.
* It doesn't matter if the shortcuts conflict with shortcuts in any other application, because the status item's menu has focus when you pop it up. Compare this with keyboard shortcuts for Services, where a conflict can be a problem, especially if you have lots of them. Kevin Callahan came up with the Action Menu precisely because the menus in Xcode 4 use so many keyboard shortcuts, including many he had been using for the Services provided by Accessorizer.
* The keyboard shortcuts can be plain characters without modifiers, which makes them easy to type and remember. This wouldn't be possible if you had to worry that a text field might have focus, because the characters would get entered into the text field.
Gesturally and conceptually what Accessorizer does, and Jerry wants to do, is similar to Command-Tab: a globally-available special keystroke enters a mode that allows you to select from a bunch of items either with the mouse or with arrow keys. (One difference is that with Command-Tab you have to keep the Command key down while you navigate.) There are third-party apps like Alfred that are even more similar in concept.
There are tradeoffs for both the user and the developer between the Action Menu approach and the Alfred approach. For some reason I find Accessorizer's approach feels very natural and appropriate for what it does. I don't know how Kevin implements it, but I suspect it's by using a custom view in the status item as has been suggested.
--Andy
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden