Quarter  1.2.2
Coin3D GUI binding for Qt
Loading...
Searching...
No Matches
SIM::Coin3D::Quarter::InputDevice Class Referenceabstract

The InputDevice class is the base class for devices such as keyboard and mouse. It can be subclassed to support other devices. More...

#include <Quarter/devices/InputDevice.h>

Inheritance diagram for SIM::Coin3D::Quarter::InputDevice:
SIM::Coin3D::Quarter::Keyboard SIM::Coin3D::Quarter::Mouse

Public Member Functions

 InputDevice (QuarterWidget *quarter)
 
void setModifiers (SoEvent *soevent, const QInputEvent *qevent)
 
void setMousePosition (const SbVec2s &pos)
 
void setWindowSize (const SbVec2s &size)
 
virtual const SoEvent * translateEvent (QEvent *event)=0
 

Protected Attributes

SbVec2s mousepos
 
QuarterWidgetquarter
 
SbVec2s windowsize
 

Detailed Description

The InputDevice class is the base class for devices such as keyboard and mouse. It can be subclassed to support other devices.

Member Function Documentation

◆ setModifiers()

void InputDevice::setModifiers ( SoEvent * soevent,
const QInputEvent * qevent )

Transforms a QEvent into an SoEvent

Parameters
[in,out]SoEventthe transformed event
[in]QEventincoming QEvent

◆ setMousePosition()

void InputDevice::setMousePosition ( const SbVec2s & pos)

Sets the mouse position

Parameters
[in]posposition of mouse in pixel coordinates

◆ setWindowSize()

void InputDevice::setWindowSize ( const SbVec2s & size)

Sets the window size of the owning window

Parameters
[in]sizein pixels

◆ translateEvent()

virtual const SoEvent * SIM::Coin3D::Quarter::InputDevice::translateEvent ( QEvent * event)
pure virtual

Subclasses must override this method to provide custom event handling

Implemented in SIM::Coin3D::Quarter::Keyboard, and SIM::Coin3D::Quarter::Mouse.

Member Data Documentation

◆ mousepos

InputDevice::mousepos
protected

Holds the last known position of the mouse. This should be set even for a keyboard event.

◆ windowsize

InputDevice::windowsize
protected

Holds the size of the owning window


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