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: KeyStroke and JMenu



Hi Elliott,

I wanted Command-`, and Command-~ on menus.

If you are writing an "international" application, don't use such shortcuts, because they are not reachable on all keyboards. For example, on a German keyboard the tilde is somewhere a combination of Ctrl and Apple and the backquote is only available with Shift.

I suggest you to stick with Ctrl/Alt/Apple/Shift combinations with letters,
space, numbers, cursor keys or function keys F1 to F12.

--
Best regards,
Thomas Singer
_____________
smartcvs.com


Elliott Hughes schrieb:
I wanted Command-`, and Command-~ on menus. I couldn't find a VK_TILDE, so I used VK_BACK_QUOTE both times, with InputEvent.SHIFT_MASK on the latter. This works fine as far as using the keyboard goes, but when my Action is in a JMenu, Command-~ shows up as Shift-Command-`.

I also wanted Command-{ and Command-} like Safari. using VK_BRACELEFT and VK_BRACERIGHT gives me the right rendering on a JMenu, but the keys don't seem to work. using shifted VK_OPEN_BRACKET and VK_CLOSE_BRACKET -- isn't KeyEvent a model of naming consistency? -- gives me the wrong rendering in a JMenu (Command-Shift-[ and Command-Shift-]), but at least the keystrokes work (and are what you'd expect: Command-{ and Command-}).

I assume this is a bug in Apple's LAF? Shifted keys that have two glyphs painted on the key cap should appear Command-<upper glyph>, right?

I'm confused by VK_BRACELEFT and VK_BRACERIGHT, mind. Either Sun have seen a keyboard with separate unshifted {, or those constants shouldn't exist.

--

Elliott Hughes, http://www.jessies.org/~enh/

_______________________________________________ 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: 
 >KeyStroke and JMenu (From: Elliott Hughes <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.