H
Hendrik Maryns
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Hi,
Although modern Macs do have a Ctrl key now, it is custom to use the Cmd
key for keyboard shortcuts. My Swing app contains a lot of actions that
have the following:
openAction.putValue(Action.NAME, "Open…");
openAction.putValue(Action.ACCELERATOR_KEY,
KeyStroke.getKeyStroke(KeyEvent.VK_O, InputEvent.CTRL_DOWN_MASK));
openAction.putValue(Action.MNEMONIC_KEY, KeyEvent.VK_O);
and then are registered in a menu. This makes the accelerator key
available automatically, as well as centralizing all information about
the menu.
Is there a general trick to tell Swing that when it is running on an
Apple, it should use Cmd for the accelerator key instead of Ctrl?
Cheers, H.
- --
Hendrik Maryns
http://tcl.sfs.uni-tuebingen.de/~hendrik/
==================
Ask smart questions, get good answers:
http://www.catb.org/~esr/faqs/smart-questions.html
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.9 (GNU/Linux)
Comment: Using GnuPG with SUSE - http://enigmail.mozdev.org
iEYEARECAAYFAkjuIBgACgkQBGFP0CTku6OUqgCdEyFp7BRPvl2F6tF6CF9qBOjn
pZwAoNRZys5lUWUtVGk1Wo70ltlOQL2c
=hoeh
-----END PGP SIGNATURE-----
Hash: SHA1
Hi,
Although modern Macs do have a Ctrl key now, it is custom to use the Cmd
key for keyboard shortcuts. My Swing app contains a lot of actions that
have the following:
openAction.putValue(Action.NAME, "Open…");
openAction.putValue(Action.ACCELERATOR_KEY,
KeyStroke.getKeyStroke(KeyEvent.VK_O, InputEvent.CTRL_DOWN_MASK));
openAction.putValue(Action.MNEMONIC_KEY, KeyEvent.VK_O);
and then are registered in a menu. This makes the accelerator key
available automatically, as well as centralizing all information about
the menu.
Is there a general trick to tell Swing that when it is running on an
Apple, it should use Cmd for the accelerator key instead of Ctrl?
Cheers, H.
- --
Hendrik Maryns
http://tcl.sfs.uni-tuebingen.de/~hendrik/
==================
Ask smart questions, get good answers:
http://www.catb.org/~esr/faqs/smart-questions.html
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.9 (GNU/Linux)
Comment: Using GnuPG with SUSE - http://enigmail.mozdev.org
iEYEARECAAYFAkjuIBgACgkQBGFP0CTku6OUqgCdEyFp7BRPvl2F6tF6CF9qBOjn
pZwAoNRZys5lUWUtVGk1Wo70ltlOQL2c
=hoeh
-----END PGP SIGNATURE-----