2 #include <msp/graphics/window_private.h>
8 void Mouse::input_event(const Graphics::Window::Event &event)
14 set_button_state(1, event.msg==WM_LBUTTONDOWN, true);
18 set_button_state(2, event.msg==WM_MBUTTONDOWN, true);
22 set_button_state(3, event.msg==WM_RBUTTONDOWN, true);
26 unsigned btn = (HIWORD(event.wparam)&0x8000) ? 5 : 4;
27 set_button_state(btn, true, true);
28 set_button_state(btn, false, true);
32 set_axis_value(0, GET_X_LPARAM(event.lparam)*2.0/window.get_width()-1.0, true);
33 set_axis_value(1, 1.0-GET_Y_LPARAM(event.lparam)*2.0/window.get_height(), true);