qnsview_key/qnsview_mouse make Ctrl+left click work again
A result of typo/incorrect keyboard modifiers extracted + wrong button sent via QWindowSystemInterface::handleMouseEvent. Task-number: QTBUG-70512 Change-Id: I809168e363496884312412051e8d435f5794b3be Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
This commit is contained in:
parent
f30bf5fbd5
commit
2e94947c56
@ -47,7 +47,7 @@
|
||||
Qt::KeyboardModifiers qtMods =Qt::NoModifier;
|
||||
if (modifierFlags & NSEventModifierFlagShift)
|
||||
qtMods |= Qt::ShiftModifier;
|
||||
if (modifierFlags & NSEventModifierFlagShift)
|
||||
if (modifierFlags & NSEventModifierFlagControl)
|
||||
qtMods |= dontSwapCtrlAndMeta ? Qt::ControlModifier : Qt::MetaModifier;
|
||||
if (modifierFlags & NSEventModifierFlagOption)
|
||||
qtMods |= Qt::AltModifier;
|
||||
|
@ -198,7 +198,9 @@
|
||||
|
||||
const auto modifiers = [QNSView convertKeyModifiers:theEvent.modifierFlags];
|
||||
const auto buttons = currentlyPressedMouseButtons();
|
||||
const auto button = cocoaButton2QtButton(theEvent);
|
||||
auto button = cocoaButton2QtButton(theEvent);
|
||||
if (button == Qt::LeftButton && m_sendUpAsRightButton)
|
||||
button = Qt::RightButton;
|
||||
const auto eventType = cocoaEvent2QtMouseEvent(theEvent);
|
||||
|
||||
QWindowSystemInterface::handleMouseEvent(targetView->m_platformWindow->window(),
|
||||
@ -266,12 +268,14 @@
|
||||
|
||||
if (m_sendUpAsRightButton && button == Qt::LeftButton)
|
||||
button = Qt::RightButton;
|
||||
if (button == Qt::RightButton)
|
||||
m_sendUpAsRightButton = false;
|
||||
|
||||
m_buttons &= ~button;
|
||||
|
||||
[self handleMouseEvent:theEvent];
|
||||
|
||||
if (button == Qt::RightButton)
|
||||
m_sendUpAsRightButton = false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user