Package com.mg105.user_interface
Class InputListener
java.lang.Object
com.mg105.user_interface.InputListener
- All Implemented Interfaces:
EventListener,javafx.event.EventHandler<javafx.scene.input.KeyEvent>
public class InputListener
extends Object
implements javafx.event.EventHandler<javafx.scene.input.KeyEvent>
InputListener takes keyboard inputs and passes them on to an appropriate interpreter.
This class is given to JavaFX and is only called by it.
-
Constructor Summary
ConstructorsConstructorDescriptionInputListener(@NotNull InputInterpreter interpreter) Create an InputListener. -
Method Summary
Modifier and TypeMethodDescriptionvoidhandle(javafx.scene.input.KeyEvent event) Pass the keyevent onto the input interpreter.
-
Constructor Details
-
InputListener
Create an InputListener.- Parameters:
interpreter- the interpreter responsible for interpreting the keyboard inputs.
-
-
Method Details
-
handle
public void handle(javafx.scene.input.KeyEvent event) Pass the keyevent onto the input interpreter.- Specified by:
handlein interfacejavafx.event.EventHandler<javafx.scene.input.KeyEvent>- Parameters:
event- the event which occurred
-