X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Finput%2Fandroid%2Ftouchscreen.cpp;h=6472f4476b973d2b813f6404af8e787f3d7e14e1;hb=49e19af2c599e7316b5a01983adc040421429f86;hp=bfbf7aaa8181c78aa73373fddf56de71b989f374;hpb=1d7113259625a91f5f6d2f53365aad22ae744689;p=libs%2Fgui.git diff --git a/source/input/android/touchscreen.cpp b/source/input/android/touchscreen.cpp index bfbf7aa..6472f44 100644 --- a/source/input/android/touchscreen.cpp +++ b/source/input/android/touchscreen.cpp @@ -1,10 +1,41 @@ +#include #include "touchscreen.h" namespace Msp { namespace Input { -void Touchscreen::input_event(const Graphics::Window::Event &) +bool Touchscreen::is_available() { + return true; +} + +void Touchscreen::input_event(const Graphics::Window::Event &event) +{ + int action = AMotionEvent_getAction(event.aevent); + int action_pointer = (action&AMOTION_EVENT_ACTION_POINTER_INDEX_MASK)>>AMOTION_EVENT_ACTION_POINTER_INDEX_SHIFT; + action &= AMOTION_EVENT_ACTION_MASK; + + int pointer_count = AMotionEvent_getPointerCount(event.aevent); + for(int i=0; i