Open Inventor Release 2024.1.1
 
Loading...
Searching...
No Matches
SoXtMouse Class Reference

Translates and reports events for the mouse device. More...

#include <Inventor/Xt/devices/SoXtMouse.h>

+ Inheritance diagram for SoXtMouse:

Public Member Functions

 SoXtMouse (EventMask mask=SO_XT_ALL_MOUSE_EVENTS)
 Constructor.
 
 ~SoXtMouse ()
 Destructor.
 
virtual void enable (SoWidget w, XtEventHandler f, XtPointer data, Window win=(Window) NULL)
 Enables the device for the passed widget.
 
virtual void disable (SoWidget w, XtEventHandler f, XtPointer data)
 Disables the device for the passed widget.
 
virtual const SoEventtranslateEvent (XAnyEvent *xevent)
 Attempts to convert the passed event into an SoEvent.
 
- Public Member Functions inherited from SoXtDevice
void setWindowSize (const SbVec2s &s)
 Sets the size of the window this device is registered for.
 
const SbVec2sgetWindowSize () const
 Gets the size of the window this device is registered for.
 
virtual ~SoXtDevice ()
 

Detailed Description

Translates and reports events for the mouse device.

This class manages events generated by the mouse, including mouse motion (SoLocation2Event), and mouse button press and release events (SoMouseButtonEvent).

SEE ALSO

SoXtDevice, SoLocation2Event, SoMouseButtonEvent

Definition at line 87 of file SoXtMouse.h.

Constructor & Destructor Documentation

◆ SoXtMouse()

SoXtMouse::SoXtMouse ( EventMask  mask = SO_XT_ALL_MOUSE_EVENTS)

Constructor.

To the constructor, pass which mouse messages you are interested in as a bitwise OR of the following values:

ButtonPressMask - Mouse down events

ButtonReleaseMask - Mouse up events

PointerMotionMask - Mouse motion with no buttons

ButtonMotionMask - Mouse motion with buttons pressed

Or simply pass the defined value SO_XT_ALL_MOUSE_EVENTS for all mouse events. The device will only report events of this type for the window it is enabled on.

◆ ~SoXtMouse()

SoXtMouse::~SoXtMouse ( )

Destructor.

Member Function Documentation

◆ disable()

virtual void SoXtMouse::disable ( SoWidget  w,
XtEventHandler  f,
XtPointer  data 
)
virtual

Disables the device for the passed widget.

Implements SoXtDevice.

◆ enable()

virtual void SoXtMouse::enable ( SoWidget  w,
XtEventHandler  f,
XtPointer  data,
Window  win = (Window) NULL 
)
virtual

Enables the device for the passed widget.

When enabled, the callback function f will be invoked when events occur in the window. data is the clientData which will be passed.

Implements SoXtDevice.

◆ translateEvent()

virtual const SoEvent * SoXtMouse::translateEvent ( XAnyEvent *  xevent)
virtual

Attempts to convert the passed event into an SoEvent.


Returns a pointer to an internal SoEvent object owned by the class. Do not delete this object. If the message was not generated by this device, then NULL is returned.

Implements SoXtDevice.


The documentation for this class was generated from the following file: