Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Keyboard Shortcuts not working



We use the following call in JMenuItem:

KeyStroke keyStroke) 

We call this with a valid keystroke that represents "Ctrl-G", for example.  This works fine on the PC, but the Mac hands this keystroke to the competing menu in the browser.

1) Is this considered a flaw that should be fixed, or is it just a different valid interpretation within their particular JRE?
2) If it's a valid interpretation, can you suggest a different way to install menu accelerators that will NOT get intercepted by the browser(s) ?

Thanks

On Tuesday, December 18, 2007, at 01:04 PM, Scott Kovatch wrote:

On Dec 18, 2007, at 7:37 AM, Patrick Flaherty wrote:

I'm having applet issue with Safari and Firefox using certain keyboard shortcuts.
It seems the browser is intercepting certain shortcuts while other make it to the applet.
For instance   command-a (select all) works in the applet even though both the applet
and browser have it defined. The applet being the focus I would expect this behavior.
But another shortcut that is defined in both the browser and the applet command-g,
never get to the applet but is instead executed by the browser.


For Swing components a command-key event will be delivered to the component, and if an action for that key exists, it will be executed. That's why Command-A does what you expect -- the Aqua L&F defines Cmd-A as select all for all components where it makes sense.

How are you defining the command-G shortcut for the applet? Can you post the code that does it? The answer and/or solution depends on who is listening for that shortcut. If you have added a JMenu and no component handled the command-g, it gets handled as a menu equivalent, but since there's no distinction between a Java menu and a non-Java menu, AppKit will trigger the first key equivalent it sees, which is in a Safari or Firefox menu.

Scott

------------------
Scott Kovatch
Apple Inc.
Java Runtime Classes
email@hidden

I am Scott Kovatch, and I approved this message.


Patrick Flaherty


Rampage Systems Inc. (781)891-9400 (Phone)
411 Waverley Oaks Rd. (781)891-1001 (Fax)
Suite 138
Waltham, MA. 02452-8405
Mailto: email@hidden



 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Java-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/java-dev/email@hidden

This email sent to email@hidden

References: 
 >Re: Keyboard Shortcuts not working (From: Scott Kovatch <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.