v0.8.0: refactored KeyAction into int constants so it can be expanded

This commit is contained in:
Evan Debenham
2019-12-13 23:22:44 -05:00
parent cb76fb8188
commit f269d68a27
15 changed files with 176 additions and 114 deletions
@@ -66,7 +66,7 @@ public class Button extends Component {
KeyEvent.addKeyListener( keyListener = new Signal.Listener<KeyEvent>() {
@Override
public boolean onSignal ( KeyEvent event ) {
if ( active && !event.pressed && KeyBindings.getBinding( event ) != null
if ( active && !event.pressed
&& KeyBindings.getBinding( event ) == keyAction()){
onClick();
return true;
@@ -78,8 +78,8 @@ public class Button extends Component {
private Signal.Listener<KeyEvent> keyListener;
public KeyAction keyAction(){
return null;
public int keyAction(){
return KeyAction.NONE;
}
@Override