Main Page Modules Class Hierarchy Compound List Compound Members
GAUGE3D::GInputMessage Class Reference
Represents an input message.
More...
#include <gauge3d/input/message.h>
Inherits GAUGE3D::GMessage.
Inherited by GAUGE3D::GKeyboardMessage, GAUGE3D::GMouseButtonMessage, GAUGE3D::GMouseMotionMessage, and GAUGE3D::GMouseWheelMessage.
List of all members.
Public Types |
enum | tFlags { DIGITAL = 0,
ANALOG = 1,
ABSOLUTE = 0,
RELATIVE = 2
} |
| Indicates the type of input.
|
Public Methods |
| GInputMessage (pGObject origin,GString name,float value,int flags) |
| Create a GInputMessage with the given info. More...
|
virtual | ~GInputMessage () |
bool | IsAnalog () |
| Returns true if the input is analog, false if digital.
|
bool | IsRelative () |
| Returns true if the input is relate, false if absolute.
|
int | Type () |
| Returns the raw bitpattern type of the message. More...
|
float | Value () |
| Returns the value of the input.
|
GString | Name () |
| Returns an identifier for the input. More...
|
Detailed Description
Represents an input message.
Input messages can be analog or digital, and they can be relative or absolute. Here's what each combination means:
- Absolute Analog: The value of the input is always between -1.0 and 1.0, and is measured relative to some central point. For example, joystick positions are normally measured this way. 0.0 is the center of the joystick, and anything else is off to one side or the other.
- Relative Analog: The value of the input could be anything. It is measured relative to the last position of the input rather than relative to some reference position. Mice are typically relative analog devices. Each mouse movement message only reports the distance that the mouse moved since the last message.
- Absolute Digital: The value of the input is either 0.0 or 1.0. This is mostly used for buttons, including mouse buttons and keys on the keyboard. A value of 1.0 means the button was pressed, whereas 0.0 means it was released.
- Relative Digital: The value of the input is either -1.0 or 1.0. The main use for this is mouse wheels, since they normally are measured in some sort of clicking fashion. 1.0 means the wheel was clicked up one notch and -1.0 means it was clicked down one notch.
Constructor & Destructor Documentation
GAUGE3D::GInputMessage::GInputMessage (
|
pGObject origin,
|
|
GString name,
|
|
float value,
|
|
int flags ) [inline]
|
|
|
Create a GInputMessage with the given info.
-
Parameters:
-
origin
|
A pointer to the object which is the logical "originator" of the message. For example, most messages will originate from a GDisplay. |
name
|
See Name(), below. |
value
|
See Value(), below. |
flags
|
A bitwise combination of the enum values of tFlags. The input must be either ANALOG or DIGITAL, and either ABSOLUTE or RELATIVE. |
|
Member Function Documentation
int GAUGE3D::GInputMessage::Type (
|
) [inline]
|
|
|
Returns the raw bitpattern type of the message.
-
Remarks:
-
This does not give you any more info than IsAnalog and IsRelative do.
|
GString GAUGE3D::GInputMessage::Name (
|
) [inline]
|
|
|
Returns an identifier for the input.
The name of the input source is a human-readable unique identifier for the source of the input. In the case of a key on the keyboard, the name might be "a" or "left control". For a mouse button, it would be "mouse1" or "mouse3". For mouse movement, "mouse x" or "mouse y". Et cetera. |
The documentation for this class was generated from the following file:
Generated at Tue Jan 30 17:07:34 2001 for gauge3d by
1.2.4 written by Dimitri van Heesch,
© 1997-2000