]> git.tdb.fi Git - libs/gui.git/blobdiff - source/input/x11/mouse.cpp
Add constants for mouse axes and buttons
[libs/gui.git] / source / input / x11 / mouse.cpp
index 3533d561fc17b4c325c60b06288a84b4e44fcfab..b8a771786a901a73a6dd8bc2a5d238b1c0b04ba9 100644 (file)
@@ -1,4 +1,5 @@
 #include <msp/graphics/window_private.h>
+#include "keys.h"
 #include "mouse.h"
 
 namespace Msp {
@@ -13,8 +14,8 @@ void Mouse::input_event(const Graphics::Window::Event &event)
                set_button_state(event.xevent.xbutton.button, event.xevent.type==ButtonPress, true);
                break;
        case MotionNotify:
-               set_axis_value(0, event.xevent.xmotion.x*2.0/window.get_width()-1.0, true);
-               set_axis_value(1, 1.0-event.xevent.xmotion.y*2.0/window.get_height(), true);
+               set_axis_value(MOUSE_X_AXIS, event.xevent.xmotion.x*2.0/window.get_width()-1.0, true);
+               set_axis_value(MOUSE_Y_AXIS, 1.0-event.xevent.xmotion.y*2.0/window.get_height(), true);
                break;
        }
 }