diff options
author | Maarten Gribnau <mail@maartengribnau.com> | 2003-01-28 01:08:51 +0300 |
---|---|---|
committer | Maarten Gribnau <mail@maartengribnau.com> | 2003-01-28 01:08:51 +0300 |
commit | 0df2cdbc2dfe2b257ba8e0322e71d49be71ee11a (patch) | |
tree | 702363f9d14d123d5b5db1334ab8a4ce1e9005c2 | |
parent | 08c376d54c8a788f3d2bd93d700af6eb5659a7c7 (diff) |
Fixed constructor of wheel event.
Limited wheel event ticks to plus and minus one on Mac.
Maarten
PS Any volunteers for X11?
-rw-r--r-- | intern/ghost/intern/GHOST_SystemCarbon.cpp | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/intern/ghost/intern/GHOST_SystemCarbon.cpp b/intern/ghost/intern/GHOST_SystemCarbon.cpp index acf3e75f860..316a0ba73a9 100644 --- a/intern/ghost/intern/GHOST_SystemCarbon.cpp +++ b/intern/ghost/intern/GHOST_SystemCarbon.cpp @@ -565,11 +565,15 @@ OSStatus GHOST_SystemCarbon::handleMouseEvent(EventRef event) //GHOST_ASSERT(status == noErr, "GHOST_SystemCarbon::handleMouseEvent(): GetEventParameter() failed"); status = ::GetEventParameter(event, kEventParamMouseWheelAxis, typeMouseWheelAxis, NULL, sizeof(axis), NULL, &axis); GHOST_ASSERT(status == noErr, "GHOST_SystemCarbon::handleMouseEvent(): GetEventParameter() failed"); - status = ::GetEventParameter(event, kEventParamMouseWheelDelta, typeLongInteger, NULL, sizeof(delta), NULL, &delta); - GHOST_ASSERT(status == noErr, "GHOST_SystemCarbon::handleMouseEvent(): GetEventParameter() failed"); if (axis == kEventMouseWheelAxisY) { - pushEvent(new GHOST_EventWheel(getMilliSeconds(), GHOST_kEventWheel, window, delta)); + status = ::GetEventParameter(event, kEventParamMouseWheelDelta, typeLongInteger, NULL, sizeof(delta), NULL, &delta); + GHOST_ASSERT(status == noErr, "GHOST_SystemCarbon::handleMouseEvent(): GetEventParameter() failed"); + /* + * Limit mouse wheel delta to plus and minus one. + */ + delta = delta > 0 ? 1 : -1; + pushEvent(new GHOST_EventWheel(getMilliSeconds(), window, delta)); } } break; |