Add contact area and orientation for pen/touch events

This commit is contained in:
Cameron Gutman
2023-07-22 17:18:57 -05:00
parent 0e29e13d03
commit 67b2853ef0
5 changed files with 124 additions and 21 deletions

View File

@@ -530,9 +530,11 @@ public class NvConnection {
}
}
public int sendTouchEvent(byte eventType, int pointerId, float x, float y, float pressure) {
public int sendTouchEvent(byte eventType, int pointerId, float x, float y, float pressureOrDistance,
float contactAreaMajor, float contactAreaMinor, short rotation) {
if (!isMonkey) {
return MoonBridge.sendTouchEvent(eventType, pointerId, x, y, pressure);
return MoonBridge.sendTouchEvent(eventType, pointerId, x, y, pressureOrDistance,
contactAreaMajor, contactAreaMinor, rotation);
}
else {
return MoonBridge.LI_ERR_UNSUPPORTED;
@@ -540,9 +542,11 @@ public class NvConnection {
}
public int sendPenEvent(byte eventType, byte toolType, byte penButtons, float x, float y,
float pressure, short rotation, byte tilt) {
float pressureOrDistance, float contactAreaMajor, float contactAreaMinor,
short rotation, byte tilt) {
if (!isMonkey) {
return MoonBridge.sendPenEvent(eventType, toolType, penButtons, x, y, pressure, rotation, tilt);
return MoonBridge.sendPenEvent(eventType, toolType, penButtons, x, y, pressureOrDistance,
contactAreaMajor, contactAreaMinor, rotation, tilt);
}
else {
return MoonBridge.LI_ERR_UNSUPPORTED;

View File

@@ -372,10 +372,12 @@ public class MoonBridge {
short leftStickX, short leftStickY,
short rightStickX, short rightStickY);
public static native int sendTouchEvent(byte eventType, int pointerId, float x, float y, float pressure);
public static native int sendTouchEvent(byte eventType, int pointerId, float x, float y, float pressure,
float contactAreaMajor, float contactAreaMinor, short rotation);
public static native int sendPenEvent(byte eventType, byte toolType, byte penButtons, float x, float y,
float pressure, short rotation, byte tilt);
float pressure, float contactAreaMajor, float contactAreaMinor,
short rotation, byte tilt);
public static native int sendControllerArrivalEvent(byte controllerNumber, short activeGamepadMask, byte type, int supportedButtonFlags, short capabilities);