Android: remove hard-coded constant for Samsung DeX (no op!)
authorSylvain Becker <sylvain.becker@gmail.com>
Thu, 17 Jan 2019 12:25:19 +0100
changeset 1255709698ac34c0e
parent 12556 9b2e48b381db
child 12558 8ca43abe9870
Android: remove hard-coded constant for Samsung DeX (no op!)

12290 = 0x3002 = SOURCE_MOUSE | SOURCE_TOUCHSCREEN

SOURCE_MOUSE Constant Value: 8194 (0x00002002)
SOURCE_TOUCHSCREEN Constant Value: 4098 (0x00001002)
SOURCE_CLASS_POINTER Constant Value: 2 (0x00000002)

https://developer.android.com/reference/android/view/InputDevice.html
android-project/app/src/main/java/org/libsdl/app/SDLActivity.java
     1.1 --- a/android-project/app/src/main/java/org/libsdl/app/SDLActivity.java	Thu Jan 17 11:05:05 2019 +0100
     1.2 +++ b/android-project/app/src/main/java/org/libsdl/app/SDLActivity.java	Thu Jan 17 12:25:19 2019 +0100
     1.3 @@ -1770,7 +1770,10 @@
     1.4          float x,y,p;
     1.5  
     1.6          // 12290 = Samsung DeX mode desktop mouse
     1.7 -        if ((event.getSource() == InputDevice.SOURCE_MOUSE || event.getSource() == 12290) && SDLActivity.mSeparateMouseAndTouch) {
     1.8 +        // 12290 = 0x3002 = 0x2002 | 0x1002 = SOURCE_MOUSE | SOURCE_TOUCHSCREEN
     1.9 +        // 0x2   = SOURCE_CLASS_POINTER
    1.10 +        if ((event.getSource() == InputDevice.SOURCE_MOUSE || event.getSource() == (InputDevice.SOURCE_MOUSE | InputDevice.SOURCE_TOUCHSCREEN))
    1.11 +                && SDLActivity.mSeparateMouseAndTouch) {
    1.12              try {
    1.13                  mouseButton = (Integer) event.getClass().getMethod("getButtonState").invoke(event);
    1.14              } catch(Exception e) {