[Commits] SDL: Support relative mouse for Samsung DeX on Samsung Experienc...

libsdl.org revision control commits-owner at libsdl.org
Mon Sep 24 11:54:36 PDT 2018


details:   https://hg.libsdl.org/SDL/rev/453f55c56b16
changeset: 12202:453f55c56b16
user:      Sam Lantinga <slouken at libsdl.org>
date:      Mon Sep 24 11:53:04 2018 -0700
description:
Support relative mouse for Samsung DeX on Samsung Experience 9.5 or later (Android 8.1 or later)

diffstat:

 android-project/app/src/main/java/org/libsdl/app/SDLActivity.java          |  11 +++++++--
 android-project/app/src/main/java/org/libsdl/app/SDLControllerManager.java |   4 +-
 2 files changed, 10 insertions(+), 5 deletions(-)

diffs (42 lines):

diff -r 8bdc4d340419 -r 453f55c56b16 android-project/app/src/main/java/org/libsdl/app/SDLActivity.java
--- a/android-project/app/src/main/java/org/libsdl/app/SDLActivity.java	Mon Sep 24 11:49:25 2018 -0700
+++ b/android-project/app/src/main/java/org/libsdl/app/SDLActivity.java	Mon Sep 24 11:53:04 2018 -0700
@@ -766,9 +766,14 @@
             return false;
         }
 
-        // Samsung DeX mode doesn't support relative mice properly under Android 7 APIs,
-        // and simply returns no data under Android 8 APIs.
-        if (isDeXMode()) {
+        // DeX mode in Samsung Experience 9.0 and earlier doesn't support relative mice properly under 
+        // Android 7 APIs, and simply returns no data under Android 8 APIs.
+        //
+        // This is fixed in Samsung Experience 9.5, which corresponds to Android 8.1.0, and
+        // thus SDK version 27.  If we are in DeX mode and not API 27 or higher, as a result,
+        // we should stick to relative mode.
+        //
+        if ((Build.VERSION.SDK_INT < 27) && isDeXMode()) {
             return false;
         }
 
diff -r 8bdc4d340419 -r 453f55c56b16 android-project/app/src/main/java/org/libsdl/app/SDLControllerManager.java
--- a/android-project/app/src/main/java/org/libsdl/app/SDLControllerManager.java	Mon Sep 24 11:49:25 2018 -0700
+++ b/android-project/app/src/main/java/org/libsdl/app/SDLControllerManager.java	Mon Sep 24 11:53:04 2018 -0700
@@ -764,7 +764,7 @@
 
     @Override
     public boolean supportsRelativeMouse() {
-        return !SDLActivity.isDeXMode();
+        return (!SDLActivity.isDeXMode() || (Build.VERSION.SDK_INT >= 27));
     }
 
     @Override
@@ -774,7 +774,7 @@
 
     @Override
     public boolean setRelativeMouseEnabled(boolean enabled) {
-        if (!SDLActivity.isDeXMode()) {
+        if (!SDLActivity.isDeXMode() || (Build.VERSION.SDK_INT >= 27)) {
             if (enabled) {
                 SDLActivity.getContentView().requestPointerCapture();
             }


More information about the commits mailing list