X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;ds=inline;f=source%2Finput%2Fmouse.cpp;h=2337f70f5aa86139be1b803c3bc6e9385d581adc;hb=695afa5452a1b1a0219badf6ac1c4183b1eefc15;hp=476275f4a77bc75024d254903abc3cb6ba74140f;hpb=5d688fbf457b1f4d3bebde431a7f58c898be584c;p=libs%2Fgui.git diff --git a/source/input/mouse.cpp b/source/input/mouse.cpp index 476275f..2337f70 100644 --- a/source/input/mouse.cpp +++ b/source/input/mouse.cpp @@ -1,6 +1,8 @@ +#ifdef WIN32 +#include +#endif #include #include -#include #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); }; } @@ -60,15 +62,15 @@ void Mouse::input_event(const Graphics::Window::Event &event) break; case WM_MBUTTONDOWN: case WM_MBUTTONUP: - set_button_state(2, event.msg==WM_LBUTTONDOWN, true); + set_button_state(2, event.msg==WM_MBUTTONDOWN, true); break; case WM_RBUTTONDOWN: case WM_RBUTTONUP: - set_button_state(3, event.msg==WM_LBUTTONDOWN, true); + set_button_state(3, event.msg==WM_RBUTTONDOWN, true); 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); }