Overcoming Keyboard Shortcut Limitations in Mac Browsers

In many ways Java has a magnificent partnership with browsers operating on Mac. However, a partnership can never be perfect and Java and Mac is no exception.

One limitation of Java applets running in Mac browsers is that certain key combinations are consumed by Mac OS X and never passed to Java. One example that can be easily seen in EditLive! is when you attempt to open either the Edit or Insert menus via their respective mnemonics (option + E and option + I).

For developers wishing to circumvent this unfortunate limitation a solution can be found by changing the name attribute for menu configuration file elements. Adding the string & before a letter in the menu name will set this letter to be the new mnemonic.

For example, here is a snippet from an EditLive! configuration file where a menu has been specified that displays the text Edit. This menu has the letter D specified as the mnemonic.

...
<menu name="E&amp;dit">
   …
</menu>

Note: changing the name attribute for a menu configuration item from it's default internationalized version to a custom string value will cause the menu item to appear the same for each user regardless of their locale.