X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Finput%2Fandroid%2Fmouse.cpp;h=6769d78f8402cd3765dd26e8324322cfd1c3aeed;hb=24da3e62cf22663ef16b61b9510fbac49308f756;hp=3fbc5bebab3affc54b8d478fcdc412f7680dd4ca;hpb=74dbff4e7e7cd427ac50820cc6366ea421d4d049;p=libs%2Fgui.git diff --git a/source/input/android/mouse.cpp b/source/input/android/mouse.cpp index 3fbc5be..6769d78 100644 --- a/source/input/android/mouse.cpp +++ b/source/input/android/mouse.cpp @@ -1,4 +1,5 @@ #include +#include "keys.h" #include "mouse.h" namespace Msp { @@ -32,8 +33,8 @@ void Mouse::input_event(const Graphics::Window::Event &event) { float x = AMotionEvent_getX(event.aevent, pointer_zero); float y = AMotionEvent_getY(event.aevent, pointer_zero); - set_axis_value(0, x*2/window.get_width()-1, true); - set_axis_value(1, 1-y*2/window.get_height(), true); + set_axis_value(MOUSE_X_AXIS, x*2/window.get_width()-1, true); + set_axis_value(MOUSE_Y_AXIS, 1-y*2/window.get_height(), true); } switch(action) @@ -43,7 +44,7 @@ void Mouse::input_event(const Graphics::Window::Event &event) case AMOTION_EVENT_ACTION_POINTER_DOWN: case AMOTION_EVENT_ACTION_POINTER_UP: if(action_pointer==0) - set_button_state(1, action==AMOTION_EVENT_ACTION_DOWN, true); + set_button_state(MOUSE_LEFT, action==AMOTION_EVENT_ACTION_DOWN, true); break; default:; }