m_sendKeyEvent = false;
m_subscribesForGlobalFrameNotifications = false;
currentCustomDragTypes = 0;
+ m_sendUpAsRightButton = false;
if (!touchDevice) {
touchDevice = new QTouchDevice;
- (void)mouseDown:(NSEvent *)theEvent
{
+ m_sendUpAsRightButton = false;
if (m_platformWindow->m_activePopupWindow) {
QWindowSystemInterface::handleCloseEvent(m_platformWindow->m_activePopupWindow);
QWindowSystemInterface::flushWindowSystemEvents();
[inputManager handleMouseEvent:theEvent];
}
} else {
- m_buttons |= Qt::LeftButton;
+ if ([self convertKeyModifiers:[theEvent modifierFlags]] & Qt::MetaModifier) {
+ m_buttons |= Qt::RightButton;
+ m_sendUpAsRightButton = true;
+ } else {
+ m_buttons |= Qt::LeftButton;
+ }
[self handleMouseEvent:theEvent];
}
}
- (void)mouseUp:(NSEvent *)theEvent
{
- m_buttons &= QFlag(~int(Qt::LeftButton));
+ if (m_sendUpAsRightButton) {
+ m_buttons &= QFlag(~int(Qt::RightButton));
+ m_sendUpAsRightButton = false;
+ } else {
+ m_buttons &= QFlag(~int(Qt::LeftButton));
+ }
[self handleMouseEvent:theEvent];
}