Actually set the modifier keys before dispatching d&d event into gecko. r=bienvenu, bug#47195

This commit is contained in:
pinkerton%netscape.com 2000-08-03 22:06:10 +00:00
Родитель 83e282cb9c
Коммит d93bedaa03
1 изменённых файлов: 18 добавлений и 1 удалений

Просмотреть файл

@ -49,6 +49,9 @@ static NS_DEFINE_IID(kIDragServiceIID, NS_IDRAGSERVICE_IID);
// This is cached for Leave notification // This is cached for Leave notification
static POINTL gDragLastPoint; static POINTL gDragLastPoint;
/* /*
* class nsNativeDragTarget * class nsNativeDragTarget
*/ */
@ -149,6 +152,16 @@ void nsNativeDragTarget::GetGeckoDragAction(DWORD grfKeyState, LPDWORD pdwEffect
} }
} }
PRBool IsKeyDown ( char key ) ;
inline
PRBool IsKeyDown ( char key )
{
return GetKeyState(key) & 0x80 ? PR_TRUE : PR_FALSE;
}
//----------------------------------------------------- //-----------------------------------------------------
void nsNativeDragTarget::DispatchDragDropEvent(PRUint32 aEventType, void nsNativeDragTarget::DispatchDragDropEvent(PRUint32 aEventType,
POINTL aPT) POINTL aPT)
@ -159,7 +172,6 @@ void nsNativeDragTarget::DispatchDragDropEvent(PRUint32 aEventType,
nsWindow * win = NS_STATIC_CAST(nsWindow *, mWindow); nsWindow * win = NS_STATIC_CAST(nsWindow *, mWindow);
win->InitEvent(event, aEventType); win->InitEvent(event, aEventType);
POINT cpos; POINT cpos;
cpos.x = aPT.x; cpos.x = aPT.x;
@ -174,6 +186,11 @@ void nsNativeDragTarget::DispatchDragDropEvent(PRUint32 aEventType,
event.point.y = 0; event.point.y = 0;
} }
event.isShift = IsKeyDown(NS_VK_SHIFT);
event.isControl = IsKeyDown(NS_VK_CONTROL);
event.isMeta = PR_FALSE;
event.isAlt = IsKeyDown(NS_VK_ALT);
mWindow->DispatchEvent(&event, status); mWindow->DispatchEvent(&event, status);
} }