SoQtMouse(3)
β¨ SoQtMouse β¨
okay so bestie, welcome to the SoQtMouse page π
this is the mouse input device abstraction for SoQt, and honestly it's kind of a big deal. it lives in the SoQt manual (section 3, iykyk) and we're gonna walk through it together, fr fr π«Ά
πΈ SYNOPSIS πΈ
#include <Inventor/Qt/devices/SoQtMouse.h>
Inherits SoQtDevice. yes bestie, it's part of the family tree π§
π Public Types π
enum Events { BUTTON_PRESS = 0x01, BUTTON_RELEASE = 0x02, POINTER_MOTION
= 0x04, BUTTON_MOTION = 0x08, ALL_EVENTS = BUTTON_PRESS |
BUTTON_RELEASE | POINTER_MOTION | BUTTON_MOTION }
π Public Member Functions π
SoQtMouse (int eventmask=ALL_EVENTS)
virtual ~SoQtMouse (void)
virtual void enable (QWidget *widget, SoQtEventHandler *handler, void
*closure)
virtual void disable (QWidget *widget, SoQtEventHandler *handler, void
*closure)
virtual const SoEvent * translateEvent (QEvent *event)
Public Member Functions inherited from SoQtDevice:
virtual ~SoQtDevice ()
void setWindowSize (const SbVec2s size)
SbVec2s getWindowSize (void) const
Public Member Functions inherited from SoQtObject:
virtual SoType getTypeId (void) const =0
SbBool isOfType (SoType type) const
π Additional Inherited Members π
Static Public Member Functions inherited from SoQtDevice:
static void initClasses (void)
Static Public Member Functions inherited from SoQtObject:
static void initClass (void)
static SoType getClassTypeId (void)
static void init (void)
Protected Member Functions inherited from SoQtDevice:
SoQtDevice (void)
void setEventPosition (SoEvent *event, int x, int y) const
void addEventHandler (QWidget *, SoQtEventHandler *, void *)
void removeEventHandler (QWidget *, SoQtEventHandler *, void *)
void invokeHandlers (QEvent *event)
Static Protected Member Functions inherited from SoQtDevice:
static SbVec2s getLastEventPosition (void)
π¦ Detailed Description π¦
So like, the SoQtMouse class is the mouse input device abstraction. that's the whole vibe. it's literally the glue between native mouse handling and all the mouse interaction happening in the Inventor scene graph π
fun fact: all components derived from the SoQtRenderArea have got an SoQtMouse device attached by default. so you're already covered, bestie, no extra setup needed β¨
okay so here's the tea β and it's important 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. like, they just don't. and we need you to know that. π
their mapping for 3-button mice is giving:
- left button:
SoMouseButtonEvent::BUTTON1 - middle button:
SoMouseButtonEvent::BUTTON2 - right button:
SoMouseButtonEvent::BUTTON3
meanwhile in this SIM SoQt library, the mappings are:
- left button:
SoMouseButtonEvent::BUTTON1 - middle button:
SoMouseButtonEvent::BUTTON3 - right button:
SoMouseButtonEvent::BUTTON2
and honestly? this is a conscious design decision we've made. periodt. the reason is that BUTTON2 should be the right mouse button whether you have a 2-button mouse or a 3-button mouse. it's giving consistency, it's giving main character energy π
π Member Enumeration Documentation π
enum SoQtMouse::Events
so this enum is literally the enumeration over supported mouse events. it's iconic, it's necessary π
BUTTON_PRESSβ the maskbit for mouse button press events π₯BUTTON_RELEASEβ the maskbit for mouse button release events π«ΆPOINTER_MOTIONβ the maskbit for mouse pointer motion events π¦BUTTON_MOTIONβ the maskbit for mouse pointer motion events with one or more mouse buttons pressed. yes, buttons pressed. it's a whole combo move πALL_EVENTSβ the mask which includes all the maskbits in the enum (i.e. use this to signal interest in all kinds of events for the mouse device). it's the "give me everything" option, and honestly? obsessed π
π₯ Constructor & Destructor Documentation π₯
SoQtMouse::SoQtMouse (int mask = ALL_EVENTS)
the constructor, bestie π the mask argument should contain the set of SoQtMouse::Events one is interested in tracking. so you get to pick your vibe, no cap.
SoQtMouse::~SoQtMouse (void ) [virtual]
the destructor. it cleans up. that's it. that's the whole note π
β Member Function Documentation β
void SoQtMouse::enable (QWidget * widget, SoQtEventHandler * handler, void * closure) [virtual]
this method will enable the device for the widget. and like, handler is invoked with the closure argument when an event occur in widget. yes bestie, that's the whole flow π§ Implements SoQtDevice.
void SoQtMouse::disable (QWidget * widget, SoQtEventHandler * handler, void * closure) [virtual]
this method will disable the handler for the device. simple as that, no drama π¦ Implements SoQtDevice.
const SoEvent * SoQtMouse::translateEvent (QEvent * event) [virtual]
okay so this one is the translator π it translates a native event from the underlying toolkit into a generic event.
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 mouse button press / release, or a mouse cursor movement event. like, it just knows. iykyk πΈ
the mapping of the mouse buttons upon generation of SoMouseButtonEvent events will be done as follows:
- left mouse button:
SoMouseButtonEvent::BUTTON1 - right mouse button:
SoMouseButtonEvent::BUTTON2 - middle mouse button, if available:
SoMouseButtonEvent::BUTTON3 - forward motion on a wheel mouse:
SoMouseButtonEvent::BUTTON4 - backward motion on a wheel mouse:
SoMouseButtonEvent::BUTTON5
note that the rightmost mouse button will always map to SoMouseButtonEvent::BUTTON2, even on a 3-button mouse. like, always. put that in your notes bestie π
Implements SoQtDevice.
π Author π
Generated automatically by Doxygen for SoQt from the source code. so like, a robot wrote this part, not me. but we're still grateful π«Ά
and that's the whole page, bestie!! π kudos for making it to the end, you're literally a scholar now, no cap ππ
Version 1.6.2 β Sat Jan 6 2024 12:20:55 β stay slaying out there, and remember: the rightmost mouse button is always BUTTON2 πβ¨π
π¦ where this page comes from
- opensuse-leap 16.0: SoQt-devel 1.6.2-bp160.1.13 Β· BSD-3-Clause
- opensuse-leap 16.0: SoQt-devel 1.6.2-bp160.1.13 Β· BSD-3-Clause
- opensuse-leap 16.0: SoQt-devel 1.6.2-bp160.1.13 Β· BSD-3-Clause
- opensuse-leap 16.0: SoQt-devel 1.6.2-bp160.1.13 Β· BSD-3-Clause
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms