NAME

Mozilla::DOM::MouseEvent

DESCRIPTION

The second argument of GtkMozEmbed's dom_mouse_* signal handlers will be a Mozilla::DOM::MouseEvent object, which is a wrapper around an instance of Mozilla's nsIDOMMouseEvent interface. This inherits from UIEvent.

* The nsIDOMMouseEvent interface is the datatype for all mouse events
* in the Document Object Model.
*
* For more information on this interface please see
* L<http:E<sol>E<sol>www.w3.orgE<sol>TRE<sol>DOM-Level-2-EventsE<sol>>

CLASS METHODS

$iid = Mozilla::DOM::MouseEvent->GetIID()

Pass this to QueryInterface.

Gets an EventTarget, but I don't know what's "related" about it since I didn't find any documentation.

METHODS

$bool = $event->GetAltKey

    This function returns true if the Alt key was held down when the mouse event occured. (Note: I found this to not be strictly true.)

$button = $event->GetButton

    This function gets a number representing which mouse button was pressed. With three-button mice: left button = 0, middle button = 1, and right button = 2. (With two-button mice, there is no middle button, and with one-button mice there is only a left button.)

    Note: this is only valid for "dom_mouse_click" in Gtk2::MozEmbed::main events.

$x = $event->GetClientX

    This function gets the X coordinate where the mouse was clicked on the client, i.e. the Gtk2::MozEmbed window. X = 0 is at the left and increases to the right.

    Note: this number might be negative on "dom_mouse_out" in Gtk2::MozEmbed::main events when the mouse leaves the Gtk2::MozEmbed widget but hasn't left the application window.

$y = $event->GetClientY

    This function gets the Y coordinate where the mouse was clicked on the client, i.e. the Gtk2::MozEmbed window. Y = 0 is at the top and increases downward.

    Note: this number might be negative on "dom_mouse_out" in Gtk2::MozEmbed::main events when the mouse leaves the Gtk2::MozEmbed widget but hasn't left the application window.

$bool = $event->GetCtrlKey

    This function returns true if the Ctrl key was held down when the mouse event occured.

$bool = $event->GetMetaKey

    This function returns true if the Meta key was held down when the mouse event occured.

$x = $event->GetScreenX

    This function gets the X coordinate where the mouse was clicked on the screen, i.e. your desktop. X = 0 is at the left and increases to the right.

$y = $event->GetScreenY

    This function gets the Y coordinate where the mouse was clicked on the screen, i.e. your desktop. Y = 0 is at the top and increases downward.

$bool = $event->GetShiftKey

    This function returns true if the Shift key was held down when the mouse event occured.

eventtarget = $event->GetTarget

$event->InitMouseEvent($eventType, $canbubble, $cancelable, $detail, $screenx, $screeny, $clientx, $clienty, $ctrlkey, $altkey, $shiftkey, $metakey, $button, $target)

    • $eventtype (string)

    • $canbubble (boolean)

    • $cancelable (boolean)

    • $detail (integer (long))

    • $screenx (integer (long))

    • $screeny (integer (long))

    • $clientx (integer (long))

    • $clienty (integer (long))

    • $ctrlkey (boolean)

    • $altkey (boolean)

    • $shiftkey (boolean)

    • $metakey (boolean)

    • $button (integer (short))

    • $target (Mozilla::DOM::EventTarget)

    See Event::InitEvent for more information. This method is basically the same as InitUIEvent, but with nine (ten normally) extra arguments. (!) (XXX: add docs for args)

    Note: I don't see how you can Create or QueryInterface an AbstractView, and trying to pass in 0 or undef was just causing a segfault, so I've omitted what would normally be the 4th argument of this method. If someone can explain why you'd need it and how you'd use it, then I can put it back in.

SEE ALSO

Mozilla::DOM, /usr/include/mozilla/nsIDOMMouseEvent.h, "section 1.6.2 of the DOM level 2 specification"

COPYRIGHT

Copyright (C) 2005, Scott Lanning

This software is licensed under the LGPL. See Mozilla::DOM for a full notice.