Keyboard Menu Control Blocked?

J. Landman Gay jacque at hyperactivesw.com
Fri Mar 12 20:56:13 EST 2010


J. Landman Gay wrote:
> Scott Rossi wrote:
>> Any thoughts on how I can track down what is preventing my menu 
>> buttons from
>> firing when triggered from the keyboard?
>>
>> I've been trying to workaround the issue of how menus are drawn when the
>> menu buttons that display menus are colorized.  I tried adding some proxy
>> buttons to trigger the menu buttons which sort of works, but somewhere 
>> along
>> the way I lost keyboard triggering of the original menu buttons.
>>
>> Possibly related:  I created a new test stack and used the Menu 
>> Builder to
>> add a standard menubar.  I noticed that the buttons in the default menu
>> display their keyboard control equivalents, whereas the buttons in my 
>> stack
>> do not.  I can't remember, is there a property/setting that enables this?
> 
> There's accelKey and accelMods. Menu buttons have some specific 
> properties that have to be set too, so compare yours with the ones 
> created by the menu builder.
> 

I should have added that you don't actually need to use these commands 
most of the time. You can indicate the keyboard shortcuts by adding 
symbols to the button contents on each line that requires one. As of 4.0 
you can find the updated syntax in the engine change log that lets you 
add keyboard shortcuts comprised of more than one modifier key. If you 
only need one modifer per menu item, you can just use the old way: put a 
slash and a letter after the menu item. For example, if you want the 
Copy item to use Cmd-C, its line in the button contents would be:

   Copy/C

Adding an ampersand after one of the letters will cause it to draw with 
an underline on Windows menus, so Copy would look like this if you want 
both the old-style underline and the command key shortcut:

   C&opy/C

The menu builder can add accelerators and modifiers via its interface 
checkboxes. If you do that and then look at the button contents, it's 
easy to see how it works.

-- 
Jacqueline Landman Gay         |     jacque at hyperactivesw.com
HyperActive Software           |     http://www.hyperactivesw.com



More information about the use-livecode mailing list