]> git.tdb.fi Git - libs/gui.git/blobdiff - source/input/android/mouse.cpp
Add touchscreen support on Android
[libs/gui.git] / source / input / android / mouse.cpp
index b16b6be2331077f48e57ddc2ee4deadde932ea01..3fbc5bebab3affc54b8d478fcdc412f7680dd4ca 100644 (file)
@@ -10,6 +10,10 @@ void Mouse::input_event(const Graphics::Window::Event &event)
        if(type!=AINPUT_EVENT_TYPE_MOTION)
                return;
 
+       int source = AInputEvent_getSource(event.aevent);
+       if(window.get_touch_input() && source!=AINPUT_SOURCE_MOUSE && source!=AINPUT_SOURCE_TOUCHPAD)
+               return;
+
        /* Emulate a mouse with the touch events of a single finger.  If more
        fingers appear while the first one is held down, they are ignored, even if
        the first finger is released. */