From: Mikol G. <amb...@gm...> - 2005-01-06 17:21:07
|
Unfortunately, simply replacing Control with Command is probably not sufficient. Consider these examples: Command Right is reserved by OS X for changing the keyboard layout to the "current layout of Roman script" (whatever that means), Command Shift Right is expected to select to the end of the current line (rather than the current word), and to select to the end of the current word, you would use Option Shift Right (where Option == Alt); OS X reserves a slew of key combinations for all sorts of arbitrary (and questionable: e.g., Command Option / to turn off font smoothing) shortcuts. [1] So not only would programatically reassigning CTRL_MASK be incorrect from the Apple HIG perspective, but doing so would often fail and could lead to confusion or worse. Seems like j should know what to do with the Command key when it sees it, but that the actual blessing of keyboard shortcuts for Mac would be handled best if it were handled manually. [1] http://developer.apple.com/documentation/UserExperience/Conceptual/OSXHIGuidelines/XHIGKeyboardShortcuts/chapter_12_section_1.html#//apple_ref/doc/uid/20000957-CH253 On Wed, 5 Jan 2005 17:54:07 -0800, Peter Graves <pe...@ar...> wrote: > On Wed, 5 Jan 2005 at 13:04:47 -0800, Frank Cohen wrote: > > I've noticed that when running J on Mac OS X using Apple's JVM 1.4.2 > > that the menu bar accelerator keys use the Control key by default. Mac > > users - including me - expect to use the Command key on a Mac keyboard. > > Is there anything in J to change the mapping of the keys? If not, would > > you be open to my contributing such a change? > > Currently there's no simple way for a user to change things so that the > Command key takes over what the Control key presently does. > > It might be a good idea to make this behavior the default on Mac OS X, > however. > > It would be nice if you could accomplish this by changing this line in > Constants.java: > > int CTRL_MASK = InputEvent.CTRL_MASK; > > to this: > > int CTRL_MASK = Platform.isPlatformMacOSX() ? <something else> > : InputEvent.CTRL_MASK; > > where <something else> needs to be replaced by the appropriate constant > for the Command key, but Constants.java is an interface, rather than a > normal class, so I don't think that's legal. > > The obvious thing to do is to define some qualified constant like > KeyMap.CTRL_MASK, initialize it appropriately in KeyMap.java, and > carefully replace all the _unqualified_ instances of CTRL_MASK in the > 41 files where that string appears with KeyMap.CTRL_MASK. > > Before doing that, however, I'd like to know if: > > (a) that accomplishes the desired effect > > (b) it doesn't break anything else on Mac OS X (it shouldn't have > any effect on other platforms) > > (c) there's no better way to do it > > It might be useful to let the user configure this behavior, but that's > a bit harder to do, and I'm not sure it would be worth the extra > trouble. > > Once we get those questions answered, I'd certainly be open to making > the changes. > > Comments? > > -Peter > > -- MEE kle |