ooodev.adapter.awt.mouse_listener module

class ooodev.adapter.awt.mouse_listener.MouseListener(trigger_args=None, subscriber=None)[source]

Bases: AdapterBase, XMouseListener

Makes it possible to receive events from the mouse in a certain window.

Use the following interfaces which allow to receive (and consume) mouse events even on windows which are not at the top:

Parameters:
  • args (Any) –

  • kwargs (Any) –

Return type:

Any

__init__(trigger_args=None, subscriber=None)[source]

Constructor:

Parameters:
  • trigger_args (GenericArgs, optional) – Args that are passed to events when they are triggered.

  • subscriber (XSlideShowView, XWindow, optional) – An UNO object that implements XSlideShowView or XWindow interface. If passed in then this instance listener is automatically added to it.

Return type:

None

disposing(event)[source]

Gets called when the broadcaster is about to be disposed.

All listeners and all other objects, which reference the broadcaster should release the reference to the source. No method should be invoked anymore on this object ( including XComponent.removeEventListener() ).

This method is called for every listener registration of derived listener interfaced, not only for registrations at XComponent.

Return type:

None

Parameters:

event (com.sun.star.lang.EventObject) –

mouseEntered(event)[source]

is invoked when the mouse enters a window.

Return type:

None

Parameters:

event (com.sun.star.awt.MouseEvent) –

mouseExited(event)[source]

is invoked when the mouse exits a window.

Return type:

None

Parameters:

event (com.sun.star.awt.MouseEvent) –

mousePressed(event)[source]

is invoked when a mouse button has been pressed on a window.

Since mouse presses are usually also used to indicate requests for pop-up menus (also known as context menus) on objects, you might receive two events for a single mouse press: For example, if, on your operating system, pressing the right mouse button indicates the request for a context menu, then you will receive one call to mousePressed() indicating the mouse click, and another one indicating the context menu request. For the latter, the MouseEvent. PopupTrigger member of the event will be set to TRUE.

Return type:

None

Parameters:

event (com.sun.star.awt.MouseEvent) –

mouseReleased(event)[source]

is invoked when a mouse button has been released on a window.

Return type:

None

Parameters:

event (com.sun.star.awt.MouseEvent) –