Added Messages to Controller For Testing Purposes

- Added Pressed, Released, and Held Messages to Controller
#story[1006]
main
Fan-Wu Yang 9 years ago
parent d6d195f381
commit ec50310137

@ -24,7 +24,10 @@ public class InputChecker {
String codeString = event.getCode().toString();
if (!currentlyActiveKeys.containsKey(codeString)) {
ControlKey controlKey = KeyFactory.getKey(codeString);
if (controlKey != null) {
controlKey.onAction();
System.out.println(controlKey.toString() + " is Pressed.");
}
currentlyActiveKeys.put(codeString, true);
}
});
@ -32,10 +35,12 @@ public class InputChecker {
scene.setOnKeyReleased(event -> {
String codeString = event.getCode().toString();
ControlKey controlKey = KeyFactory.getKey(codeString);
if (controlKey != null) {
controlKey.onRelease();
currentlyActiveKeys.remove(event.getCode().toString());
System.out.println(controlKey.toString() + " is Released.");
}
);
currentlyActiveKeys.remove(event.getCode().toString());
});
new AnimationTimer() {
@Override
@ -44,7 +49,7 @@ public class InputChecker {
ControlKey controlKey = KeyFactory.getKey(key);
if (controlKey != null){
controlKey.onHold();
System.out.println(controlKey.toString() + " is Pressed.");
System.out.println(controlKey.toString() + " is Held.");
}
}
// for (String key : InputKeys.stringKeysMap.keySet()){

Loading…
Cancel
Save