X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Finput%2Fmouse.cpp;h=937a89ea6aa3fbe52cac884de1827904785bf375;hb=43d31e73c4b97a37017757232c4ef1db355fee3a;hp=1b41e3654517c2adb12d02e5cb10821df70a5764;hpb=1aca77b93853ee127ac3bbf6886f7f04920542ef;p=libs%2Fgui.git diff --git a/source/input/mouse.cpp b/source/input/mouse.cpp index 1b41e36..937a89e 100644 --- a/source/input/mouse.cpp +++ b/source/input/mouse.cpp @@ -1,10 +1,12 @@ #include +#include "keys.h" #include "mouse.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);