diff options
author | Alexander Sulfrian <alexander@sulfrian.net> | 2012-09-17 01:42:45 +0200 |
---|---|---|
committer | Alexander Sulfrian <alexander@sulfrian.net> | 2013-01-13 22:41:06 +0100 |
commit | 668fb8ae01d1a09ba2bf2faf52d17e8edcf541e1 (patch) | |
tree | 1a2d03f65460a09cc6b63c0a43b8d6a41c61b162 /src | |
parent | 7c290476afd877cf4be48f458a6d2666a2562c8c (diff) | |
download | usdx-668fb8ae01d1a09ba2bf2faf52d17e8edcf541e1.tar.gz usdx-668fb8ae01d1a09ba2bf2faf52d17e8edcf541e1.tar.xz usdx-668fb8ae01d1a09ba2bf2faf52d17e8edcf541e1.zip |
menu/event_manager: add more mouse events
Diffstat (limited to '')
-rw-r--r-- | src/menu/event_manager.cpp | 8 | ||||
-rw-r--r-- | src/menu/event_manager.hpp | 4 | ||||
-rw-r--r-- | src/menu/software_mouse_pointer.cpp | 2 | ||||
-rw-r--r-- | src/menu/software_mouse_pointer.hpp | 2 |
4 files changed, 13 insertions, 3 deletions
diff --git a/src/menu/event_manager.cpp b/src/menu/event_manager.cpp index bc7168af..cb15352a 100644 --- a/src/menu/event_manager.cpp +++ b/src/menu/event_manager.cpp @@ -103,6 +103,14 @@ namespace usdx case SDL_MOUSEMOTION: mouse_move(event.motion.x, event.motion.y); + break; + + case SDL_MOUSEBUTTONDOWN: + mouse_down(event.button.button, event.button.x, event.button.y); + break; + + case SDL_MOUSEBUTTONUP: + mouse_up(event.button.button, event.button.x, event.button.y); } } } diff --git a/src/menu/event_manager.hpp b/src/menu/event_manager.hpp index 6fd37c1a..7c2738d1 100644 --- a/src/menu/event_manager.hpp +++ b/src/menu/event_manager.hpp @@ -122,7 +122,9 @@ namespace usdx bool available(void); - boost::signals2::signal<void (int, int)> mouse_move; + boost::signals2::signal<void (uint16_t, uint16_t)> mouse_move; + boost::signals2::signal<void (uint8_t, uint16_t, uint16_t)> mouse_down; + boost::signals2::signal<void (uint8_t, uint16_t, uint16_t)> mouse_up; }; }; diff --git a/src/menu/software_mouse_pointer.cpp b/src/menu/software_mouse_pointer.cpp index a3594479..99aed07a 100644 --- a/src/menu/software_mouse_pointer.cpp +++ b/src/menu/software_mouse_pointer.cpp @@ -97,7 +97,7 @@ namespace usdx glDisableClientState(GL_COLOR_ARRAY); } - void SoftwareMousePointer::on_mouse_move(int x, int y) + void SoftwareMousePointer::on_mouse_move(uint16_t x, uint16_t y) { set_position(x, y); fade_inactive->update(); diff --git a/src/menu/software_mouse_pointer.hpp b/src/menu/software_mouse_pointer.hpp index 2706e335..0e3d2ff8 100644 --- a/src/menu/software_mouse_pointer.hpp +++ b/src/menu/software_mouse_pointer.hpp @@ -58,7 +58,7 @@ namespace usdx SoftwareMousePointer(Container* parent, EventManager* event_manager); virtual ~SoftwareMousePointer(); - void on_mouse_move(int x, int y); + void on_mouse_move(uint16_t x, uint16_t y); }; }; |