|
|
|
|
Re: Setting Ctrl-+ as keystroke on a table [message #1403233 is a reply to message #1403225] |
Tue, 22 July 2014 14:33 |
Jeremie Bresson Messages: 1252 Registered: October 2011 |
Senior Member |
|
|
I had a look at Bug 422753. I think the correct way to define a shortcut using the numeric keypad goes like this:
@Order(10.0)
public class NumPadPlusKeyStroke extends AbstractKeyStroke {
@Override
protected String getConfiguredKeyStroke() {
return "CTRL-ADD";
}
@Override
protected void execAction() throws ProcessingException {
MessageBox.showOkMessage(null, getClass().getSimpleName(), null);
}
}
@Order(20.0)
public class NumPadMinusKeyStroke extends AbstractKeyStroke {
@Override
protected String getConfiguredKeyStroke() {
return "CTRL-SUBTRACT";
}
@Override
protected void execAction() throws ProcessingException {
MessageBox.showOkMessage(null, getClass().getSimpleName(), null);
}
}
@Order(30.0)
public class NumPadSlashKeyStroke extends AbstractKeyStroke {
@Override
protected String getConfiguredKeyStroke() {
return "CTRL-DIVIDE";
}
@Override
protected void execAction() throws ProcessingException {
MessageBox.showOkMessage(null, getClass().getSimpleName(), null);
}
}
@Order(40.0)
public class NumPadMultiplyKeyStroke extends AbstractKeyStroke {
@Override
protected String getConfiguredKeyStroke() {
return "CTRL-MULTIPLY";
}
@Override
protected void execAction() throws ProcessingException {
MessageBox.showOkMessage(null, getClass().getSimpleName(), null);
}
}
}
It works (with SWT and Swing).
We should document it on the KeyStroke wiki page.
.
[Updated on: Tue, 22 July 2014 14:34] Report message to a moderator
|
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03012 seconds