|
Sweet Home 3D Forum » List all forums » » Forum: Developers » » » Thread: How to add a shortcut key to my plugin menu item? |
|
| Print at Dec 20, 2025, 4:54:55 PM | |
| Posted by jaffguo at Oct 28, 2016, 10:06:01 PM |
|
How to add a shortcut key to my plugin menu item? Hi, I'm wondering if there would be a way to add a shortcut key to my customized plugin menu item. thanks, jaff |
| Posted by Puybaret at Nov 2, 2016, 3:33:35 PM |
|
Re: How to add a shortcut key to my plugin menu item? You can add shortcut by binding an instance of KeyStroke with an action that will execute your plugin. The good place to program this should be in the method getActions of your plug-in : public PluginAction [] getActions() {If you want that the shortcut appears beside the menu item of the plug-in, you'll have to find the menu item in the menu bar returned by ((JFrame)SwingUtilities.getWindowAncestor((JComponent)getHomeController().getView())).---------------------------------------- Emmanuel Puybaret, Sweet Home 3D creator |
| Posted by jaffguo at Nov 3, 2016, 12:20:12 PM |
Re: How to add a shortcut key to my plugin menu item?I very much appreciate your help, Ennanuel. It works well. Thanks a lot. Jaff |
|
|
Current timezone is GMT Dec 20, 2025, 4:54:55 PM |