X-Git-Url: http://www2.svjatoslav.eu/gitweb/?a=blobdiff_plain;f=src%2Fmain%2Fjava%2Feu%2Fsvjatoslav%2Fsixth%2Fe3d%2Fgui%2Fhumaninput%2FHIDInputTracker.java;h=af0ae3104fa42dfe325ea2e4e0bb5a533ea52cf4;hb=f4f24fac9a22e6f05f6e1115d3a578513fbbd03c;hp=dd19b6055f0f72ea2583777107333228a1ff4783;hpb=197ac1b87328bb5b06ba52d3768af04b2007b087;p=sixth-3d.git diff --git a/src/main/java/eu/svjatoslav/sixth/e3d/gui/humaninput/HIDInputTracker.java b/src/main/java/eu/svjatoslav/sixth/e3d/gui/humaninput/HIDInputTracker.java index dd19b60..af0ae31 100755 --- a/src/main/java/eu/svjatoslav/sixth/e3d/gui/humaninput/HIDInputTracker.java +++ b/src/main/java/eu/svjatoslav/sixth/e3d/gui/humaninput/HIDInputTracker.java @@ -1,10 +1,7 @@ /* - * Sixth 3D engine. Author: Svjatoslav Agejenko. + * Sixth 3D engine. Author: Svjatoslav Agejenko. * This project is released under Creative Commons Zero (CC0) license. - * -* */ - package eu.svjatoslav.sixth.e3d.gui.humaninput; import eu.svjatoslav.sixth.e3d.geometry.Point2D; @@ -19,6 +16,12 @@ import java.util.HashMap; import java.util.List; import java.util.Map; +/** + * Human input device input tracker. + *
+ * Idea is to capture all keyboard and mouse inputs from underlying operating system in this class
+ * and forward those as needed to subsequent virtual components.
+ */
public class HIDInputTracker implements
MouseMotionListener, KeyListener, MouseListener, MouseWheelListener, ViewRenderListener {
@@ -72,7 +75,7 @@ public class HIDInputTracker implements
* @return true
if view needs to be repainted.
*/
private boolean handleKeyboardEvents() {
- final UserInputHandler currentFocusOwner = viewPanel.getKeyboardFocusStack().getCurrentFocusOwner();
+ final KeyboardInputHandler currentFocusOwner = viewPanel.getKeyboardFocusStack().getCurrentFocusOwner();
ArrayListtrue
if view update is needed.
*/
private boolean forwardKeyboardEventsToFocusOwner(
- UserInputHandler currentFocusOwner, ArrayListtrue
if view needs to be repainted.
*/
private boolean handleMouseDragging() {
- // TODO: need to detect whether user moved mouse or touch screen
+ // TODO: It would be nice here to detect somehow whether user moved mouse or touch screen.
+ // in case of touch screen, we would like to reverse movement along X and Y axis.
final Avatar avatar = viewPanel.getAvatar();
// for mouse