From 6e1af6a051b5129c0703dd654794427094d672c8 Mon Sep 17 00:00:00 2001 From: rubidium Date: Mon, 19 Jan 2009 22:27:43 +0000 Subject: (svn r15156) -Fix: add scrollwheel support to allegro --- src/video/allegro_v.cpp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src') diff --git a/src/video/allegro_v.cpp b/src/video/allegro_v.cpp index 455c991d2..e0509aa52 100644 --- a/src/video/allegro_v.cpp +++ b/src/video/allegro_v.cpp @@ -381,6 +381,13 @@ static void PollEvent() mouse_action = true; } + static int prev_mouse_z = 0; + if (prev_mouse_z != mouse_z) { + _cursor.wheel = (prev_mouse_z - mouse_z) < 0 ? -1 : 1; + prev_mouse_z = mouse_z; + mouse_action = true; + } + if (mouse_action) HandleMouseEvents(); poll_keyboard(); -- cgit v1.2.3-54-g00ecf