Coin Logo Coin3D is Free Software,
published under the BSD 3-clause license.
https://coin3d.github.io
https://www.kongsberg.com/en/kogt/
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)
 
virtual const SoEventtranslateEvent (QEvent *event)=0
 
void setMousePosition (const SbVec2s &pos)
 
void setWindowSize (const SbVec2s &size)
 
void setModifiers (SoEvent *soevent, const QInputEvent *qevent)
 

Protected Attributes

SbVec2s mousepos
 
SbVec2s windowsize
 
QuarterWidgetquarter
 

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

◆ 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::Mouse, and SIM::Coin3D::Quarter::Keyboard.

◆ 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

◆ setModifiers()

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

Transforms a QEvent into an SoEvent

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

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: