Custom key binding in oXygen applet

Having trouble installing Oxygen? Got a bug to report? Post it all here.
Ruskiz
Posts: 2
Joined: Mon Jan 16, 2012 5:46 pm

Custom key binding in oXygen applet

Post by Ruskiz »

Hi.
How to add custom key bindings for the applet?
I need add CTRL+S for "Save" action (and on custom action), because by default is not work.
Thank you.
Radu
Posts: 9448
Joined: Fri Jul 09, 2004 5:18 pm

Re: Custom key binding in oXygen applet

Post by Radu »

Hi,

The applet is based on Swing components, so on the AuthorComponentSample constructor you can add code like:

Code: Select all

getActionMap().put("SAVE_APPLET", myAction);
getInputMap(WHEN_ANCESTOR_OF_FOCUSED_COMPONENT).put(KeyStroke.getKeyStroke(KeyEvent.VK_S, KeyEvent.CTRL_MASK), "SAVE_APPLET");
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
Ruskiz
Posts: 2
Joined: Mon Jan 16, 2012 5:46 pm

Re: Custom key binding in oXygen applet

Post by Ruskiz »

Thank you. This is what I needed.
Post Reply