522 qDebug("QOleDropSource::QueryContinueDrag(fEscapePressed %d, grfKeyState %d)", fEscapePressed, grfKeyState); |
522 qDebug("QOleDropSource::QueryContinueDrag(fEscapePressed %d, grfKeyState %d)", fEscapePressed, grfKeyState); |
523 #endif |
523 #endif |
524 |
524 |
525 if (fEscapePressed) { |
525 if (fEscapePressed) { |
526 return ResultFromScode(DRAGDROP_S_CANCEL); |
526 return ResultFromScode(DRAGDROP_S_CANCEL); |
527 } else if (!(grfKeyState & (MK_LBUTTON|MK_MBUTTON|MK_RBUTTON))) { |
527 } else if ((GetAsyncKeyState(VK_LBUTTON) == 0) |
|
528 && (GetAsyncKeyState(VK_MBUTTON) == 0) |
|
529 && (GetAsyncKeyState(VK_RBUTTON) == 0)) { |
|
530 // grfKeyState is broken on CE & some Windows XP versions, |
|
531 // therefore we need to check the state manually |
528 return ResultFromScode(DRAGDROP_S_DROP); |
532 return ResultFromScode(DRAGDROP_S_DROP); |
529 } else { |
533 } else { |
530 #if defined(Q_OS_WINCE) |
534 #if !defined(Q_OS_WINCE) |
531 // grfKeyState is broken on CE, therefore need to check |
|
532 // the state manually |
|
533 if ((GetAsyncKeyState(VK_LBUTTON) == 0) && |
|
534 (GetAsyncKeyState(VK_MBUTTON) == 0) && |
|
535 (GetAsyncKeyState(VK_RBUTTON) == 0)) { |
|
536 return ResultFromScode(DRAGDROP_S_DROP); |
|
537 } |
|
538 #else |
|
539 if (currentButtons == Qt::NoButton) { |
535 if (currentButtons == Qt::NoButton) { |
540 currentButtons = keystate_to_mousebutton(grfKeyState); |
536 currentButtons = keystate_to_mousebutton(grfKeyState); |
541 } else { |
537 } else { |
542 Qt::MouseButtons buttons = keystate_to_mousebutton(grfKeyState); |
538 Qt::MouseButtons buttons = keystate_to_mousebutton(grfKeyState); |
543 if (!(currentButtons & buttons)) |
539 if (!(currentButtons & buttons)) |