diff options
Diffstat (limited to 'embed/mozilla/EventContext.cpp')
-rw-r--r-- | embed/mozilla/EventContext.cpp | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/embed/mozilla/EventContext.cpp b/embed/mozilla/EventContext.cpp index 229f8d3be..5d8e30075 100644 --- a/embed/mozilla/EventContext.cpp +++ b/embed/mozilla/EventContext.cpp @@ -525,7 +525,22 @@ nsresult EventContext::GetMouseEventInfo (nsIDOMMouseEvent *aMouseEvent, EphyEmb /* casting 32-bit guint* to PRUint16* below will break on big-endian */ PRUint16 btn; aMouseEvent->GetButton (&btn); - info->mouse_button = (guint)btn; + + switch (btn) + { + case 0: + info->type = EPHY_EMBED_EVENT_MOUSE_BUTTON1; + break; + case 1: + info->type = EPHY_EMBED_EVENT_MOUSE_BUTTON2; + break; + case 2: + info->type = EPHY_EMBED_EVENT_MOUSE_BUTTON3; + break; + + default: + g_warning ("Unknown mouse button"); + } /* OTOH, casting only between (un)signedness is safe */ aMouseEvent->GetScreenX ((PRInt32*)&info->x); @@ -590,6 +605,8 @@ nsresult EventContext::GetKeyEventInfo (nsIDOMKeyEvent *aKeyEvent, EphyEmbedEven { nsresult rv; + info->type = EPHY_EMBED_EVENT_KEY; + PRUint32 keyCode; rv = aKeyEvent->GetKeyCode(&keyCode); if (NS_FAILED(rv)) return rv; |