|
Re: Correct way to create hotkeys [message #871767 is a reply to message #871219] |
Mon, 14 May 2012 20:30 |
|
Hi Patrick
The action of the keystroke is only executed if the field containing the keystroke has the focus. So you can put it into a group box and if one field of that box has the focus the keystroke should work.
Which UI are you using? It seems that ctrl-h does not work with the swing ui, maybe it's used for something else? With the swt ui it works fine. shift-h seems to work for both.
If you are wondering whether your keystroke gets registered you could add a breakpoint in SwingScoutAction#attachScout
Btw: Global keystrokes are registered on the desktop. When creating a new scout project it should automatically add one, the refresh outline keystroke:
@Order(10.0)
public class RefreshOutlineKeyStroke extends AbstractKeyStroke {
@Override
protected String getConfiguredKeyStroke() {
return "f5";
}
@Override
protected void execAction() throws ProcessingException {
if (getOutline() != null) {
IPage page = getOutline().getActivePage();
if (page != null) {
page.reloadPage();
}
}
}
}
Regards
Claudio
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03706 seconds