Open Inventor Release 2023.2.3
 
Loading...
Searching...
No Matches
SoQtKeyboard Class Reference

VSG extension Translates and reports events for the keyboard device. More...

#include <Inventor/Qt/devices/SoQtKeyboard.h>

+ Inheritance diagram for SoQtKeyboard:

Public Member Functions

 SoQtKeyboard (EventMask mask=SO_QT_ALL_KEYBOARD_EVENTS)
 Constructor.
 
 ~SoQtKeyboard ()
 Destructor.
 
virtual void enable (QWidget *w, XtEventHandler f, XtPointer data, void *unused=NULL)
 Enables the device for the passed widget.
 
virtual void disable (QWidget *w, XtEventHandler f, XtPointer data)
 Disables the device for the passed widget.
 
virtual const SoEventtranslateEvent (QEvent *event)
 Attempts to convert the passed event into an SoEvent.
 
- Public Member Functions inherited from SoQtDevice
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, in pixels, this device is registered for.
 

Detailed Description

VSG extension Translates and reports events for the keyboard device.

This class manages events generated by the keyboard, including key press and release events (SoKeyboardEvent).

Note :
With Qt, there is no difference between the left and right Window/Meta keys. So SoKeyboardEvent::LEFT_META is returned when either of these keys is pressed.

SEE ALSO

SoQtDevice, SoKeyboardEvent

Definition at line 55 of file SoQtKeyboard.h.

Constructor & Destructor Documentation

◆ SoQtKeyboard()

SoQtKeyboard::SoQtKeyboard ( EventMask  mask = SO_QT_ALL_KEYBOARD_EVENTS)

Constructor.

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

KeyPressMask - Key press messages

KeyReleaseMask - Key release messages

Or simply pass the defined value SO_QT_ALL_KEYBOARD_EVENTS for all keyboard events. The device will only report events of this type for the widget it is enabled on.

◆ ~SoQtKeyboard()

SoQtKeyboard::~SoQtKeyboard ( )

Destructor.

Member Function Documentation

◆ disable()

virtual void SoQtKeyboard::disable ( QWidget *  w,
XtEventHandler  f,
XtPointer  data 
)
virtual

Disables the device for the passed widget.

Implements SoQtDevice.

◆ enable()

virtual void SoQtKeyboard::enable ( QWidget *  w,
XtEventHandler  f,
XtPointer  data,
void *  unused = 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 SoQtDevice.

◆ translateEvent()

virtual const SoEvent * SoQtKeyboard::translateEvent ( QEvent *  event)
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 SoQtDevice.


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