]> git.tdb.fi Git - libs/gui.git/blobdiff - source/input/mouse.cpp
Provide access to the desktop mode
[libs/gui.git] / source / input / mouse.cpp
index 476275f4a77bc75024d254903abc3cb6ba74140f..fce870f23aaf367b54155b55f5b9af82b0b51ac3 100644 (file)
@@ -1,6 +1,8 @@
+#ifdef WIN32
+#include <windowsx.h>
+#endif
 #include <msp/graphics/window.h>
 #include <msp/graphics/window_priv.h>
-#include <msp/strings/format.h>
 #include "mouse.h"
 
 namespace Msp {
@@ -32,7 +34,7 @@ std::string Mouse::get_button_name(unsigned btn) const
        case 5:
                return "Wheel Down";
        default:
-               return format("Button %d", btn);
+               return Device::get_button_name(btn);
        }
 }
 
@@ -45,7 +47,7 @@ std::string Mouse::get_axis_name(unsigned axis) const
        case 1:
                return "Y axis";
        default:
-               return format("Axis %d", axis);
+               return Device::get_axis_name(axis);
        };
 }
 
@@ -68,7 +70,7 @@ void Mouse::input_event(const Graphics::Window::Event &event)
                break;
        case WM_MOUSEWHEEL:
                {
-                       unsigned btn = (HIWORD(wp)&0x8000) ? 5 : 4;
+                       unsigned btn = (HIWORD(event.wparam)&0x8000) ? 5 : 4;
                        set_button_state(btn, true, true);
                        set_button_state(btn, false, true);
                }