2 #include <msp/graphics/window_private.h>
9 void Mouse::input_event(const Graphics::Window::Event &event)
11 // http://msdn.microsoft.com/en-us/library/windows/desktop/ms703320.aspx
12 if(window.get_touch_input() && (event.extra&0xFFFFFF00)==0xFF515700)
19 set_button_state(MOUSE_LEFT, event.msg==WM_LBUTTONDOWN, true);
23 set_button_state(MOUSE_MIDDLE, event.msg==WM_MBUTTONDOWN, true);
27 set_button_state(MOUSE_RIGHT, event.msg==WM_RBUTTONDOWN, true);
31 unsigned btn = (HIWORD(event.wparam)&0x8000) ? MOUSE_WHEEL_DOWN : MOUSE_WHEEL_UP;
32 set_button_state(btn, true, true);
33 set_button_state(btn, false, true);
37 set_axis_value(MOUSE_X_AXIS, GET_X_LPARAM(event.lparam)*2.0/window.get_width()-1.0, true);
38 set_axis_value(MOUSE_Y_AXIS, 1.0-GET_Y_LPARAM(event.lparam)*2.0/window.get_height(), true);