Cocoa: bugfix mouse wheel + modifier keys not working

To avoid using modifier keys when releasing a two-finger
mouse wheel flick on a trackpad, we listen to event
phases. But for a normal mouse, a separate phase
NSEventPhaseNone is given. Ensure that we still send
modifier keys when that state is reported.

Task-number: QTBUG-32098
Change-Id: Ib840dd661b7842ae49127e5a8d42e3666ae2da4e
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
This commit is contained in:
Richard Moe Gustavsen 2013-08-13 09:54:40 +02:00 committed by The Qt Project
parent 37215efeea
commit bab29dd76c
1 changed files with 2 additions and 2 deletions

View File

@ -872,13 +872,13 @@ static QTouchDevice *touchDevice = 0;
#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_7
if ([theEvent respondsToSelector:@selector(scrollingDeltaX)]) {
NSEventPhase phase = [theEvent phase];
if (phase == NSEventPhaseBegan) {
if (phase == NSEventPhaseBegan || phase == NSEventPhaseNone) {
currentWheelModifiers = [QNSView convertKeyModifiers:[theEvent modifierFlags]];
}
QWindowSystemInterface::handleWheelEvent(m_window, qt_timestamp, qt_windowPoint, qt_screenPoint, pixelDelta, angleDelta, currentWheelModifiers);
if (phase == NSEventPhaseEnded || phase == NSEventPhaseCancelled) {
if (phase == NSEventPhaseEnded || phase == NSEventPhaseCancelled || phase == NSEventPhaseNone) {
currentWheelModifiers = Qt::NoModifier;
}
} else