Added Messages to Controller For Testing Purposes
- Added Pressed, Released, and Held Messages to Controller #story[1006]
This commit is contained in:
@@ -24,18 +24,23 @@ public class InputChecker {
|
||||
String codeString = event.getCode().toString();
|
||||
if (!currentlyActiveKeys.containsKey(codeString)) {
|
||||
ControlKey controlKey = KeyFactory.getKey(codeString);
|
||||
controlKey.onAction();
|
||||
if (controlKey != null) {
|
||||
controlKey.onAction();
|
||||
System.out.println(controlKey.toString() + " is Pressed.");
|
||||
}
|
||||
currentlyActiveKeys.put(codeString, true);
|
||||
}
|
||||
});
|
||||
|
||||
scene.setOnKeyReleased(event -> {
|
||||
String codeString = event.getCode().toString();
|
||||
ControlKey controlKey = KeyFactory.getKey(codeString);
|
||||
controlKey.onRelease();
|
||||
currentlyActiveKeys.remove(event.getCode().toString());
|
||||
}
|
||||
);
|
||||
String codeString = event.getCode().toString();
|
||||
ControlKey controlKey = KeyFactory.getKey(codeString);
|
||||
if (controlKey != null) {
|
||||
controlKey.onRelease();
|
||||
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()){
|
||||
|
||||
Reference in New Issue
Block a user