I'm working on the Linkage Mechanism Designer and Simulator for the Mac. It's a mechanical design CAD program/app. I have a fully working version for Windows so I wanted to port it to the Mac and do things in an Apple-ish sort of way.
I have a shortcut key on Windows, the "A" key, that will add a connector to the currently selected link at a point near it's center. I've expanded that on the Mac so the connector is added at the location of the mouse pointer when the key is pressed. In an effort to be "complete", I have an edit menu item named "Add Connector" and it shows the "A" shortcut key.
The problem is that if the user is using the menu item and not the shortcut key, the mouse pointer is not over their document/mechanism and the menu should not do anything. it only works right when the mouse is over the document window.
My options are many:
Disable the menu item only when the menu is visible. This will imply that the document is not in a state to accept a new connector so it's a bad idea.
Show a message about how the key is the only way to use the menu item effectively. I would add a "don't show again" option to this message. I would beep from then on if they use the menu item.
Remove the menu item and just detect the keypress. This violates the idea that all actions are represented by menu items. I like having the option in the menu.
Just add the connector somewhere like in the center of the editor window or in the center of the selected link.
Any thoughts on how to handle this? So far, I'm inclined to show a message or just make a beep sound when the menu item is used directly.
Oh, and it's going to be an interesting challenge to actually detect if the menu was used vs. the shortcut key. I suspect that I will cheat and detect key-down events to catch the key before the menu item is even triggered. Then I can simply act on the menu item knowing that it can't get used except from the menu.
Thanks for the help.