diff options
Diffstat (limited to 'platform/android/java/lib')
| -rw-r--r-- | platform/android/java/lib/src/org/godotengine/godot/GodotLib.java | 5 | ||||
| -rw-r--r-- | platform/android/java/lib/src/org/godotengine/godot/input/GodotInputHandler.java | 13 | 
2 files changed, 17 insertions, 1 deletions
diff --git a/platform/android/java/lib/src/org/godotengine/godot/GodotLib.java b/platform/android/java/lib/src/org/godotengine/godot/GodotLib.java index 067fa6f4b9..67dce172dc 100644 --- a/platform/android/java/lib/src/org/godotengine/godot/GodotLib.java +++ b/platform/android/java/lib/src/org/godotengine/godot/GodotLib.java @@ -95,6 +95,11 @@ public class GodotLib {  	public static native void touch(int what, int pointer, int howmany, int[] arr);  	/** +	 * Forward hover events from the main thread to the GL thread. +	 */ +	public static native void hover(int type, int x, int y); + +	/**  	 * Forward accelerometer sensor events from the main thread to the GL thread.  	 * @see android.hardware.SensorEventListener#onSensorChanged(SensorEvent)  	 */ diff --git a/platform/android/java/lib/src/org/godotengine/godot/input/GodotInputHandler.java b/platform/android/java/lib/src/org/godotengine/godot/input/GodotInputHandler.java index 2beca67922..2756ca6c83 100644 --- a/platform/android/java/lib/src/org/godotengine/godot/input/GodotInputHandler.java +++ b/platform/android/java/lib/src/org/godotengine/godot/input/GodotInputHandler.java @@ -188,7 +188,18 @@ public class GodotInputHandler implements InputDeviceListener {  				}  				return true;  			} -		}; +		} else if ((event.getSource() & InputDevice.SOURCE_STYLUS) == InputDevice.SOURCE_STYLUS) { +			final int x = Math.round(event.getX()); +			final int y = Math.round(event.getY()); +			final int type = event.getAction(); +			queueEvent(new Runnable() { +				@Override +				public void run() { +					GodotLib.hover(type, x, y); +				} +			}); +			return true; +		}  		return false;  	}  |