From 72ee43e9470c6fdbc6ed7ff92b85dfa5062c5762 Mon Sep 17 00:00:00 2001 From: Stijn Buys Date: Tue, 6 Jan 2015 18:51:37 +0000 Subject: Added separate event handlers for mouse button clicks and mouse wheel movement. --- src/ui/iconbutton.cc | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) (limited to 'src/ui/iconbutton.cc') diff --git a/src/ui/iconbutton.cc b/src/ui/iconbutton.cc index b8dda87..944ae6c 100644 --- a/src/ui/iconbutton.cc +++ b/src/ui/iconbutton.cc @@ -105,9 +105,9 @@ void IconButton::draw_border() } } -bool IconButton::on_keypress(const int key, const unsigned int modifier) +bool IconButton::on_mousepress(const unsigned int button) { - if (key == 512 + SDL_BUTTON_LEFT) { + if (button == SDL_BUTTON_LEFT) { if (enabled()) { if (iconbutton_command.size()) { core::cmd() << iconbutton_command << std::endl; @@ -121,11 +121,6 @@ bool IconButton::on_keypress(const int key, const unsigned int modifier) return false; } -bool IconButton::on_keyrelease(const int key, const unsigned int modifier) -{ - return false; -} - void IconButton::on_mouseover(const math::Vector2f &cursor) { if (enabled()) { -- cgit v1.2.3