Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Class Members | File Members | Related Pages

Phx::LogicalInputEngine::ButtonSpecState Class Reference

A value type that specifies a raw button with a ButtonSpec and a state for that button. More...

#include <PhxLogicalInputEngine.h>

List of all members.

Public Member Functions

 ButtonSpecState ()
 Constructs a default ButtonSpecState.
 ButtonSpecState (const String &driverName, RawInputEngine::ButtonIdentifier button, RawInputEngine::ButtonState triggerState)
 Constructs a ButtonSpecState directly from a driver name, identifier, and ButtonState.
 ButtonSpecState (const LogicalInputEngine::ButtonSpec &buttonSpec, RawInputEngine::ButtonState triggerState)
 Constructs a ButtonSpecState from an existing ButtonSpec and the additional trigger state.
bool operator== (const ButtonSpecState &b)
 Equality comparison between two ButtonSpecState's.
bool operator!= (const ButtonSpecState &b)
 Inequality comparison between two ButtonSpecState's.
const LogicalInputEngine::ButtonSpecbuttonSpec () const
 Gets the ButtonSpec that identifies a raw input button.
RawInputEngine::ButtonState triggerState () const
 Gets the trigger state that specifies the state the raw button must enter in order for the logical input engine to regard the button as "triggered".


Detailed Description

A value type that specifies a raw button with a ButtonSpec and a state for that button.

This exists because, in addition to specifying which buttons must be checked by the logical input layer, we must also specify what state they should be in. This requirement shows up in two places.

First, multi-state buttons are not simply "pressed" or "not pressed". It's unclear whether such buttons will be used frequently (it is certainly possible to reduce these cases to simple binary buttons) but since the RawInputEngine does not prevent drivers from outputing more than the standard PRESSED and RELEASED states, the key binder must be able to specify to the LogicalInputEngine which of the states should trigger the logical button or axis.

A more common issue involves modifier keys. The logical input layer has no knowledge of "modifier" keys and hence will interpret Control-A as pressing "Control" and "A" separately. As a result, when Control-A is pressed, a driver that is looking only at the "A" key will incorrectly identify the key press as "Control-A" and not simply "A". Thus, if one action is bound to Control-A and another to A, then both will be triggered when Control-A is pressed. To avoid this scenario the key binder must specify explicitly that Control must not be held when "A" is pressed.


Constructor & Destructor Documentation

Phx::LogicalInputEngine::ButtonSpecState::ButtonSpecState  )  [inline]
 

Constructs a default ButtonSpecState.

The buttonSpec() attribute will simply be the default constructed (and invalid) ButtonSpec. triggerState() will be RawInputEngine::PRESSED.

Phx::LogicalInputEngine::ButtonSpecState::ButtonSpecState const LogicalInputEngine::ButtonSpec buttonSpec,
RawInputEngine::ButtonState  triggerState
[inline]
 

Constructs a ButtonSpecState from an existing ButtonSpec and the additional trigger state.

Parameters:
buttonSpec The ButtonSpec designating a raw button.
triggerState The state in which the logical input drivers will regard the raw button as triggered.


Member Function Documentation

const LogicalInputEngine::ButtonSpec& Phx::LogicalInputEngine::ButtonSpecState::buttonSpec  )  const [inline]
 

Gets the ButtonSpec that identifies a raw input button.

Returns:
A ButtonSpec designating a particular button in the RawInputEngine.

bool Phx::LogicalInputEngine::ButtonSpecState::operator!= const ButtonSpecState b  )  [inline]
 

Inequality comparison between two ButtonSpecState's.

Returns:
!this->operator==(b)

bool Phx::LogicalInputEngine::ButtonSpecState::operator== const ButtonSpecState b  )  [inline]
 

Equality comparison between two ButtonSpecState's.

Returns:
True when the buttonSpec() and triggerState() attributes of the two ButtonSpecState's are equal.

RawInputEngine::ButtonState Phx::LogicalInputEngine::ButtonSpecState::triggerState  )  const [inline]
 

Gets the trigger state that specifies the state the raw button must enter in order for the logical input engine to regard the button as "triggered".

Returns:
The button state in which the raw button specified in buttonSpec() will be considered triggered.


The documentation for this class was generated from the following file:
Generated on Wed Dec 21 22:05:38 2005 for Phoenix OSFS by  doxygen 1.4.2