]> git.tdb.fi Git - libs/gui.git/blobdiff - source/input/mouse.cpp
Include the matching header first in .cpp files
[libs/gui.git] / source / input / mouse.cpp
index 1b41e3654517c2adb12d02e5cb10821df70a5764..e379576363a3d29bff734fcf341036334e89c035 100644 (file)
@@ -1,10 +1,12 @@
-#include <msp/graphics/window.h>
 #include "mouse.h"
+#include <msp/graphics/window.h>
+#include "keys.h"
 
 namespace Msp {
 namespace Input {
 
 Mouse::Mouse(Graphics::Window &w):
+       Device(MOUSE),
        window(w)
 {
        name = "Mouse";
@@ -19,15 +21,15 @@ std::string Mouse::get_button_name(unsigned btn) const
 {
        switch(btn)
        {
-       case 1:
+       case MOUSE_LEFT:
                return "Left";
-       case 2:
+       case MOUSE_MIDDLE:
                return "Middle";
-       case 3:
+       case MOUSE_RIGHT:
                return "Right";
-       case 4:
+       case MOUSE_WHEEL_UP:
                return "Wheel Up";
-       case 5:
+       case MOUSE_WHEEL_DOWN:
                return "Wheel Down";
        default:
                return Device::get_button_name(btn);
@@ -38,9 +40,9 @@ std::string Mouse::get_axis_name(unsigned axis) const
 {
        switch(axis)
        {
-       case 0:
+       case MOUSE_X_AXIS:
                return "X axis";
-       case 1:
+       case MOUSE_Y_AXIS:
                return "Y axis";
        default:
                return Device::get_axis_name(axis);