зеркало из https://github.com/mozilla/pjs.git
added mouseEvent struct
This commit is contained in:
Родитель
05950ddc0a
Коммит
80bf79605f
|
@ -85,6 +85,21 @@ struct nsScrollbarEvent : public nsGUIEvent {
|
|||
};
|
||||
|
||||
|
||||
/**
|
||||
* Mouse event
|
||||
*/
|
||||
|
||||
struct nsMouseEvent : public nsGUIEvent {
|
||||
/// PR_TRUE indicates the shift key in down
|
||||
PRBool isShift;
|
||||
/// PR_TRUE indicates the control key in down
|
||||
PRBool isControl;
|
||||
/// PR_TRUE indicates the alt key in down
|
||||
PRBool isAlt;
|
||||
/// The number of mouse clicks
|
||||
PRUint32 clickCount;
|
||||
};
|
||||
|
||||
/**
|
||||
* Keyboard event
|
||||
*/
|
||||
|
|
|
@ -1581,10 +1581,15 @@ PRBool nsWindow::DispatchMouseEvent(PRUint32 aEventType)
|
|||
return result;
|
||||
}
|
||||
|
||||
// nsMouseEvent event;
|
||||
nsGUIEvent event;
|
||||
nsMouseEvent event;
|
||||
InitEvent(event, aEventType);
|
||||
|
||||
event.isShift = GetKeyState(VK_LSHIFT) < 0 || GetKeyState(VK_RSHIFT) < 0;
|
||||
event.isControl = GetKeyState(VK_LCONTROL) < 0 || GetKeyState(VK_RCONTROL) < 0;
|
||||
event.isAlt = GetKeyState(VK_LMENU) < 0 || GetKeyState(VK_RMENU) < 0;
|
||||
event.clickCount = (aEventType == NS_MOUSE_LEFT_DOUBLECLICK ||
|
||||
aEventType == NS_MOUSE_LEFT_DOUBLECLICK)? 2:1;
|
||||
|
||||
// call the event callback
|
||||
if (nsnull != mEventCallback) {
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче