Android: Added mapping of mouse forward button and mouse back button.
authorPhilipp Wiesemann <philipp.wiesemann@arcor.de>
Mon, 11 Jan 2016 20:02:48 +0100
changeset 10049 0052384f717f
parent 10048 b86bef2d4f30
child 10050 2cbe9f525260
Android: Added mapping of mouse forward button and mouse back button.
src/video/android/SDL_androidmouse.c
--- a/src/video/android/SDL_androidmouse.c	Sat Jan 09 17:41:09 2016 -0400
+++ b/src/video/android/SDL_androidmouse.c	Mon Jan 11 20:02:48 2016 +0100
@@ -37,6 +37,8 @@
 #define BUTTON_PRIMARY 1
 #define BUTTON_SECONDARY 2
 #define BUTTON_TERTIARY 4
+#define BUTTON_BACK 8
+#define BUTTON_FORWARD 16
 
 void Android_OnMouse( int androidButton, int action, float x, float y) {
     static Uint8 SDLButton;
@@ -53,6 +55,10 @@
                 SDLButton = SDL_BUTTON_RIGHT;
             } else if (androidButton == BUTTON_TERTIARY) {
                 SDLButton = SDL_BUTTON_MIDDLE;
+            } else if (androidButton == BUTTON_FORWARD) {
+                SDLButton = SDL_BUTTON_X1;
+            } else if (androidButton == BUTTON_BACK) {
+                SDLButton = SDL_BUTTON_X2;
             }
             SDL_SendMouseMotion(Android_Window, 0, 0, x, y);
             SDL_SendMouseButton(Android_Window, 0, SDL_PRESSED, SDLButton);