Translates and reports events for the keyboard device. More...
#include <Inventor/Xt/devices/SoXtKeyboard.h>
Public Member Functions | |
SoXtKeyboard (EventMask mask=SO_XT_ALL_KEYBOARD_EVENTS) | |
~SoXtKeyboard () | |
virtual void | enable (SoWidget w, XtEventHandler f, XtPointer data, Window win=(Window) NULL) |
virtual void | disable (SoWidget w, XtEventHandler f, XtPointer data) |
virtual const SoEvent * | translateEvent (XAnyEvent *xevent) |
Translates and reports events for the keyboard device.
This class manages events generated by the keyboard, including key press and release events (SoKeyboardEvent).
SoXtKeyboard::SoXtKeyboard | ( | EventMask | mask = SO_XT_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_XT_ALL_KEYBOARD_EVENTS for all keyboard events. The device will only report events of this type for the widget it is enabled on.
SoXtKeyboard::~SoXtKeyboard | ( | ) |
Destructor.
virtual void SoXtKeyboard::disable | ( | SoWidget | w, | |
XtEventHandler | f, | |||
XtPointer | data | |||
) | [virtual] |
Disables the device for the passed widget.
Implements SoXtDevice.
virtual void SoXtKeyboard::enable | ( | SoWidget | w, | |
XtEventHandler | f, | |||
XtPointer | data, | |||
Window | win = (Window) 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 SoXtDevice.
virtual const SoEvent* SoXtKeyboard::translateEvent | ( | XAnyEvent * | xevent | ) | [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 SoXtDevice.