.TH "SoQtMouse" 3 "Sun Dec 11 2011" "Version 1.5.0" "SoQt" \" -*- nroff -*- .ad l .nh .SH NAME SoQtMouse \- .PP The \fBSoQtMouse\fP class is the mouse input device abstraction\&. .PP The \fBSoQtMouse\fP class is the glue between native mouse handling and mouse interaction in the Inventor scenegraph\&. .SH SYNOPSIS .br .PP .PP \fC#include \fP .PP Inherits \fBSoQtDevice\fP\&. .SS "Public Types" .in +1c .ti -1c .RI "enum \fBEvents\fP { \fBBUTTON_PRESS\fP = 0x01, \fBBUTTON_RELEASE\fP = 0x02, \fBPOINTER_MOTION\fP = 0x04, \fBBUTTON_MOTION\fP = 0x08, \fBALL_EVENTS\fP = BUTTON_PRESS | BUTTON_RELEASE | POINTER_MOTION | BUTTON_MOTION }" .br .in -1c .SS "Public Member Functions" .in +1c .ti -1c .RI "\fBSoQtMouse\fP (int eventmask=\fBALL_EVENTS\fP)" .br .ti -1c .RI "virtual \fB~SoQtMouse\fP (void)" .br .ti -1c .RI "virtual void \fBenable\fP (QWidget *widget, SoQtEventHandler *handler, void *closure)" .br .ti -1c .RI "virtual void \fBdisable\fP (QWidget *widget, SoQtEventHandler *handler, void *closure)" .br .ti -1c .RI "virtual const SoEvent * \fBtranslateEvent\fP (QEvent *event)" .br .in -1c .SS "Friends" .in +1c .ti -1c .RI "class \fBSoQtMouseP\fP" .br .ti -1c .RI "class \fBSoGuiMouseP\fP" .br .in -1c .SH "Detailed Description" .PP The \fBSoQtMouse\fP class is the mouse input device abstraction\&. .PP The \fBSoQtMouse\fP class is the glue between native mouse handling and mouse interaction in the Inventor scenegraph\&. All components derived from the \fBSoQtRenderArea\fP have got an \fBSoQtMouse\fP device attached by default\&. .PP One important note for application programmers: our mappings to SoMouseButtonEvent::BUTTON2 and SoMouseButtonEvent::BUTTON3 do not match the mappings in SGI's InventorXt library or TGS's SoWin library for 3-button mice\&. They map mouse buttons like this: .PP .PD 0 .IP "\(bu" 2 left button: SoMouseButtonEvent::BUTTON1 .IP "\(bu" 2 middle button: SoMouseButtonEvent::BUTTON2 .IP "\(bu" 2 right button: SoMouseButtonEvent::BUTTON3 .PP .PP While in this SIM \fBSoQt\fP library the mappings are: .PP .PD 0 .IP "\(bu" 2 left button: SoMouseButtonEvent::BUTTON1 .IP "\(bu" 2 middle button: SoMouseButtonEvent::BUTTON3 .IP "\(bu" 2 right button: SoMouseButtonEvent::BUTTON2 .PP .PP This is a conscious design decision we've made\&. The reason is that BUTTON2 should be the right mouse button whether you have a 2-button mouse or a 3-button mouse\&. .SH "Member Enumeration Documentation" .PP .SS "enum \fBSoQtMouse::Events\fP"Enumeration over supported mouse events\&. .PP \fBEnumerator: \fP .in +1c .TP \fB\fIBUTTON_PRESS \fP\fP Maskbit for mousebutton press events\&. .TP \fB\fIBUTTON_RELEASE \fP\fP Maskbit for mousebutton release events\&. .TP \fB\fIPOINTER_MOTION \fP\fP Maskbit for mousepointer motion events\&. .TP \fB\fIBUTTON_MOTION \fP\fP Maskbit for mousepointer motion events with one or more mousebuttons pressed\&. .TP \fB\fIALL_EVENTS \fP\fP Mask which includes all the maskbits in the enum (ie use this to signal interest in all kinds of events for the mouse device)\&. .SH "Constructor & Destructor Documentation" .PP .SS "\fBSoQtMouse::SoQtMouse\fP (intmask = \fC\fBALL_EVENTS\fP\fP)"Constructor\&. The \fImask\fP argument should contain the set of \fBSoQtMouse::Events\fP one is interested in tracking\&. .SS "\fBSoQtMouse::~SoQtMouse\fP (void)\fC [virtual]\fP"Destructor\&. .SH "Member Function Documentation" .PP .SS "void \fBSoQtMouse::enable\fP (QWidget *widget, SoQtEventHandler *handler, void *closure)\fC [virtual]\fP"This method will enable the device for the widget\&. .PP \fIhandler\fP is invoked with the \fIclosure\fP argument when an event occur in \fIwidget\fP\&. .PP Implements \fBSoQtDevice\fP\&. .SS "void \fBSoQtMouse::disable\fP (QWidget *widget, SoQtEventHandler *handler, void *closure)\fC [virtual]\fP"This method will disable the handler for the device\&. .PP Implements \fBSoQtDevice\fP\&. .SS "const SoEvent * \fBSoQtMouse::translateEvent\fP (QEvent *event)\fC [virtual]\fP"Translates a native event from the underlying toolkit into a generic event\&. .PP This is then returned in the form of an instance of a subclass of the Inventor API's SoEvent class, either an SoMouseButtonEvent or an SoLocation2Event, depending on whether the native event is a mousebutton press / release, or a mousecursor movement event\&. .PP The mapping of the mousebuttons upon generation of SoMouseButtonEvent events will be done as follows: .PP .PD 0 .IP "\(bu" 2 left mousebutton: SoMouseButtonEvent::BUTTON1 .IP "\(bu" 2 right mousebutton: SoMouseButtonEvent::BUTTON2 .IP "\(bu" 2 middle mousebutton, if available: SoMouseButtonEvent::BUTTON3 .IP "\(bu" 2 forward motion on a wheel mouse: SoMouseButtonEvent::BUTTON4 .IP "\(bu" 2 backward motion on a wheel mouse: SoMouseButtonEvent::BUTTON5 .PP .PP Note that the rightmost mousebutton will always map to SoMouseButtonEvent::BUTTON2, even on a 3-button mouse\&. .PP Implements \fBSoQtDevice\fP\&. .PP References BUTTON_MOTION, BUTTON_PRESS, BUTTON_RELEASE, POINTER_MOTION, and SoQtDevice::setEventPosition()\&. .SH "Author" .PP Generated automatically by Doxygen for SoQt from the source code\&.