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=303f195ee9fe82b1a5e5095d89ad2a6aaed676a5;hpb=0590faa0f0434ebb29955a711299f8ad5ac226d6;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 303f195..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,12 +1,7 @@ /* - * Sixth 3D engine. Copyright ©2012-2018, Svjatoslav Agejenko, svjatoslav@svjatoslav.eu - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of version 3 of the GNU Lesser General Public License - * or later as published by the Free Software Foundation. - * + * 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; @@ -21,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 {
@@ -74,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