Fixed git clone URL
[sixth-3d.git] / src / main / java / eu / svjatoslav / sixth / e3d / gui / humaninput / KeyboardInputHandler.java
1 /*
2  * Sixth 3D engine. Author: Svjatoslav Agejenko.
3  * This project is released under Creative Commons Zero (CC0) license.
4  */
5 package eu.svjatoslav.sixth.e3d.gui.humaninput;
6
7 import eu.svjatoslav.sixth.e3d.gui.ViewPanel;
8
9 import java.awt.event.KeyEvent;
10
11 /**
12  * This is the process:
13  * <p>
14  * 1. Component receives focus, perhaps because user clicked on it with the mouse.
15  * 2. Now component will receive user key press and release events from the keyboard.
16  * 3. Component loses focus. Perhaps user chose another component to interact with.
17  */
18 public interface KeyboardInputHandler {
19
20     /**
21      * @return <code>true</code> if view needs to be re-rendered.
22      */
23     boolean focusLost(ViewPanel viewPanel);
24
25     /**
26      * @return <code>true</code> if view needs to be re-rendered.
27      */
28     boolean focusReceived(ViewPanel viewPanel);
29
30     /**
31      * @return <code>true</code> if view needs to be re-rendered.
32      */
33     boolean keyPressed(KeyEvent event, ViewPanel viewPanel);
34
35     /**
36      * @return <code>true</code> if view needs to be re-rendered.
37      */
38     boolean keyReleased(KeyEvent event, ViewPanel viewPanel);
39
40 }