Re: handling command / control keys
Tristan Richard <[email protected]>
| Newsgroups | gmane.comp.embedded.carlsbad-cubes |
|---|---|
| Message-ID | <[email protected]> |
There again, I quite agree with you, the best way to do it is a special attribute in xml, but I'd rather prefer this kind ot syntax : <menuitem action="exitAction" accelerator="control Q" macos_meta_accelerator="true" macos_quit="true"/> Like you, I have to write it in Java while waiting for a patch But I definitely think this should be handled by SwiXml - Tristan masukomi a écrit : > I was just telling Wolf that I wrote something today that will traverse > a menu bar and make the switch if appropriate but I don't think that's > the best solution. > I think that, if this should be in swixml, it should happen during > processing or be implemented as a special tag. > > <menuitem text="foo"><osModifiableAccelerator accellerator="control N" > /></menuitem> > > if a special tag like above, or if done in the Parser, it would swap > all instance of "control" for "meta" and vice versa as appropriate > prior to generating the KeyStroke. > > -Kate > > > On May 5, 2004, at 7:31 PM, Tristan Richard wrote: > >> I quite agree with you, we should have the equivalent of the java code : >> >> //Cross platform ctrl key mask >> int ctrl = Toolkit.getDefaultToolkit().getMenuShortcutKeyMask(); >> >> Which means control key on Win/Linux and Meta on Mac... >> >> I vote for this feature request too >> >> Tristan >> >> masukomi a écrit : >> >>> I've set up my accelerators in the XML with control keys (^+n = new, >>> etc) but that's damn annoying on the mac. Is there some simple thing >>> I'm missing that will allow me to set the right one without having >>> to write a class / function to read in my menus and convert all the >>> controls to commands if the person happens to be on a mac? >>> If not.... would it be useful to have that as a potential switch >>> that could be added? For example before calling >>> SwingEngine.render(...) you set some flag that then tells the Parser >>> to make sure the menu accellerators are the appropriate ones for the >>> os. Event.CTRL_MASK becomes Event.META_MASK if you're on a mac and >>> vice-versa if you're not. >>> -Kate >>> ---------------------------------------------------------------------- >>> -- >>> _______________________________________________ >>> Forum mailing list >>> [email protected] >>> http://carlsbadcubes.com/mailman/listinfo/forum_carlsbadcubes.com >> >> >> >> _______________________________________________ >> Forum mailing list >> [email protected] >> http://carlsbadcubes.com/mailman/listinfo/forum_carlsbadcubes.com >> >> >