Get context popup menus work on Mac by checking if the CTRL key is down (just like how the Mac's Finder works).

This commit is contained in:
rjc%netscape.com 1999-06-07 05:43:09 +00:00
parent ab56353b31
commit 9638765196
2 changed files with 18 additions and 4 deletions

View File

@ -168,10 +168,17 @@ XULPopupListenerImpl::MouseDown(nsIDOMEvent* aMouseEvent)
}
break;
case eXULPopupType_context:
#ifdef XP_MAC
// XXX: Handle Mac (currently checks if CTRL key is down)
PRBool ctrlKey = PR_FALSE;
uiEvent->GetCtrlKey(&ctrlKey);
if (ctrlKey == PR_TRUE)
#else
// Check for right mouse button down
uiEvent->GetButton(&button);
// XXX: Handle Mac
if (button == 3) {
if (button == 3)
#endif
{
// Time to launch a context menu.
LaunchPopup(aMouseEvent);
}

View File

@ -168,10 +168,17 @@ XULPopupListenerImpl::MouseDown(nsIDOMEvent* aMouseEvent)
}
break;
case eXULPopupType_context:
#ifdef XP_MAC
// XXX: Handle Mac (currently checks if CTRL key is down)
PRBool ctrlKey = PR_FALSE;
uiEvent->GetCtrlKey(&ctrlKey);
if (ctrlKey == PR_TRUE)
#else
// Check for right mouse button down
uiEvent->GetButton(&button);
// XXX: Handle Mac
if (button == 3) {
if (button == 3)
#endif
{
// Time to launch a context menu.
LaunchPopup(aMouseEvent);
}