This class represents a controller input device, such as a gamepad or joystick. More...
#include <controller.h>
Inheritance diagram for Mezzanine::Input::Controller:
Collaboration diagram for Mezzanine::Input::Controller:Public Member Functions | |||
| Controller (void *InternalControl, int Count) | |||
| Class constructor. More... | |||
| virtual | ~Controller () | ||
| Class destructor. | |||
| Int16 | GetAxis (const UInt16 Axis) const | ||
| This Gets the value of the given joystick axis. More... | |||
| Int16 | GetAxis (const Input::InputCode &Axis) const | ||
| This Gets the value of the given joystick axis. More... | |||
| virtual const Input::ButtonState & | GetButtonState (const UInt16 Button) const | ||
| Gets the state of the requested button. More... | |||
| virtual const Input::ButtonState & | GetButtonState (const Input::InputCode &Button) const | ||
| Gets the state of the requested button. More... | |||
| UInt16 | GetDeviceIndex () const | ||
| Gets the device index of this controller. More... | |||
| const String & | GetDeviceName () const | ||
| Gets the name of this device. More... | |||
| const Input::HatState & | GetHatState (const UInt16 Hat) const | ||
| Gets the current state of the requested hat. More... | |||
| const Input::HatState & | GetHatState (const Input::InputCode &Hat) const | ||
| Gets the current state of the requested hat. More... | |||
| UInt16 | GetNumAxes () const | ||
| Gets the number of Axes on this device. More... | |||
| UInt16 | GetNumHats () const | ||
| Gets the number of Hats on this device. More... | |||
| UInt16 | GetNumTrackballs () const | ||
| Gets the number of Trackballs on this device. More... | |||
| Vector2 | GetTrackballDelta (const UInt16 Trackball) const | ||
| Gets the delta movement on the requested trackball. More... | |||
| Real | GetTrackballDelta (const Input::InputCode &Trackball) const | ||
| Gets the delta movement on the requested trackball. More... | |||
| Real | GetTrackballDeltaX (const UInt16 Trackball) const | ||
| Gets the delta movement on the X axis on the requested trackball. More... | |||
| Real | GetTrackballDeltaY (const UInt16 Trackball) const | ||
| Gets the delta movement on the Y axis on the requested trackball. More... | |||
| Boole | IsHatPushedInDirection (const UInt16 Hat, const Input::HatState &WhichWay) const | ||
| Gets whether a specific hat is pressed in a specific direction. More... | |||
Public Member Functions inherited from Mezzanine::Input::ButtonDevice | |||
| ButtonDevice () | |||
| Class constructor. | |||
| virtual | ~ButtonDevice () | ||
| Class destructor. | |||
| void | _Update (const MetaCodeContainer &DeltaCodes, MetaCodeContainer &GeneratedCodes) | ||
| Updates this device with the newest data. More... | |||
| Boole | CheckButtonState (const UInt16 Button, const Input::ButtonState &State) const | ||
| Checks to see if a button on this device is a specific state. More... | |||
| Boole | CheckButtonState (const Input::InputCode &Button, const Input::ButtonState &State) const | ||
| Checks to see if a button on this device is a specific state. More... | |||
| UInt16 | GetNumButtons () const | ||
| Gets the number of buttons on this device. More... | |||
| Boole | IsButtonLifting (const UInt16 Button) const | ||
| Gets whether or not a device button was lifted this frame. More... | |||
| Boole | IsButtonLifting (const Input::InputCode &Button) const | ||
| Gets whether or not a device button was lifted this frame. More... | |||
| Boole | IsButtonPressed (const UInt16 Button) const | ||
| Gets whether or not a device button is pressed down. More... | |||
| Boole | IsButtonPressed (const Input::InputCode &Button) const | ||
| Gets whether or not a device button is pressed down. More... | |||
| Boole | IsButtonPressing (const UInt16 Button) const | ||
| Gets whether or not a device button was pressed this frame. More... | |||
| Boole | IsButtonPressing (const Input::InputCode &Button) const | ||
| Gets whether or not a device button was pressed this frame. More... | |||
| Boole | IsButtonTransitioning (const UInt16 Button) const | ||
| Gets whether or not a device button was lifted or pressed this frame. More... | |||
| Boole | IsButtonTransitioning (const Input::ButtonState &Button) const | ||
| Gets whether or not a device button was lifted or pressed this frame. More... | |||
Public Member Functions inherited from Mezzanine::Input::Device | |||
| Device () | |||
| Class constructor. | |||
| virtual | ~Device () | ||
| Class destructor. | |||
| void | AddInputSequence (const MetaCodeContainer &Codes, const Int32 &SequenceID) | ||
Adds a custom sequence of inputs that this system will look for and generate MetaCode's for when they occur.
| |||
| Int32 | GetIDofInputSequence (const MetaCodeContainer &Codes) | ||
Gets the ID of the provided sequence of MetaCode's.
| |||
| Boole | InputSequenceExists (const MetaCodeContainer &Codes) | ||
Checks to see if the provided sequence of MetaCode's is already being checked for.
| |||
| void | RemoveAllInputSequences () | ||
| Removes all stored input sequences. More... | |||
| void | RemoveInputSequence (const MetaCodeContainer &Codes) | ||
Removes the specified custom sequence of MetaCode's.
| |||
Protected Member Functions | |
| virtual void | AddPressedButtons (MetaCodeContainer &GeneratedCodes) const |
| void | UpdateImpl (const MetaCodeContainer &DeltaCodes, MetaCodeContainer &GeneratedCodes) |
| Internal implementation of the device update. More... | |
| virtual void | VerifySequenceImpl (const MetaCodeContainer &Sequence) const |
Protected Member Functions inherited from Mezzanine::Input::ButtonDevice | |
| void | UpdateButtonTransitions () |
| Updates transitioning buttons. More... | |
Protected Attributes | |
| std::vector< Int16 > | Axes |
| Container storing the states for each axis on the controller. More... | |
| String | DeviceName |
| The name of the controller device. More... | |
| std::vector< Input::HatState > | Hats |
| Container storing the states for each hat on the controller. More... | |
| UInt16 | Index |
| The index of the controller device. More... | |
| std::vector< Vector2 > | Trackballs |
| Container storing the states for each trackball on the controller. More... | |
Protected Attributes inherited from Mezzanine::Input::ButtonDevice | |
| std::vector< Input::ButtonState > | Buttons |
| A container of states for each button on the input device. More... | |
| std::vector< Whole > | TransitioningIndexes |
| A container of indexes being tracked due to state transitions. More... | |
Protected Attributes inherited from Mezzanine::Input::Device | |
| SequenceContainer | Sequences |
| A container for storing and detecting input sequences for an input device. More... | |
This class represents a controller input device, such as a gamepad or joystick.
Definition at line 54 of file controller.h.
| Mezzanine::Input::Controller::Controller | ( | void * | InternalControl, |
| int | Count | ||
| ) |
Class constructor.
| InternalControl | A pointer to the internal struct of this controller. |
Definition at line 53 of file controller.cpp.
|
protectedvirtual |
Implements Mezzanine::Input::ButtonDevice.
Definition at line 112 of file controller.cpp.
This Gets the value of the given joystick axis.
| Axis | The axis that you want. This value is expected to be 1-20. |
Definition at line 142 of file controller.cpp.
| Int16 Mezzanine::Input::Controller::GetAxis | ( | const Input::InputCode & | Axis | ) | const |
This Gets the value of the given joystick axis.
| Axis | An InputCode representing the axis that you want. |
Definition at line 157 of file controller.cpp.
|
virtual |
Gets the state of the requested button.
Implements Mezzanine::Input::ButtonDevice.
Definition at line 175 of file controller.cpp.
|
virtual |
Gets the state of the requested button.
Implements Mezzanine::Input::ButtonDevice.
Definition at line 178 of file controller.cpp.
|
virtual |
Gets the device index of this controller.
Implements Mezzanine::Input::Device.
Definition at line 124 of file controller.cpp.
| const String & Mezzanine::Input::Controller::GetDeviceName | ( | ) | const |
Gets the name of this device.
Definition at line 127 of file controller.cpp.
| const Input::HatState & Mezzanine::Input::Controller::GetHatState | ( | const UInt16 | Hat | ) | const |
Gets the current state of the requested hat.
| Hat | The hat to query. This value is expected to be 1-6. |
Definition at line 154 of file controller.cpp.
| const Input::HatState & Mezzanine::Input::Controller::GetHatState | ( | const Input::InputCode & | Hat | ) | const |
Gets the current state of the requested hat.
| Hat | An InputCode representing the hat to query. |
Definition at line 181 of file controller.cpp.
| UInt16 Mezzanine::Input::Controller::GetNumAxes | ( | ) | const |
Gets the number of Axes on this device.
Definition at line 130 of file controller.cpp.
| UInt16 Mezzanine::Input::Controller::GetNumHats | ( | ) | const |
Gets the number of Hats on this device.
Definition at line 136 of file controller.cpp.
| UInt16 Mezzanine::Input::Controller::GetNumTrackballs | ( | ) | const |
Gets the number of Trackballs on this device.
Definition at line 133 of file controller.cpp.
Gets the delta movement on the requested trackball.
| Trackball | The trackball to query. This value is expected to be at least 1. |
Definition at line 145 of file controller.cpp.
| Real Mezzanine::Input::Controller::GetTrackballDelta | ( | const Input::InputCode & | Trackball | ) | const |
Gets the delta movement on the requested trackball.
| Trackball | An InputCode representing the trackball to query. |
| A | InvalidParametersException is thrown if anything other than a controllerball value from the Input enum is passed. |
Definition at line 160 of file controller.cpp.
Gets the delta movement on the X axis on the requested trackball.
| Trackball | The trackball to query. This value is expected to be at least 1. |
Definition at line 148 of file controller.cpp.
Gets the delta movement on the Y axis on the requested trackball.
| Trackball | The trackball to query. This value is expected to be at least 1. |
Definition at line 151 of file controller.cpp.
| Boole Mezzanine::Input::Controller::IsHatPushedInDirection | ( | const UInt16 | Hat, |
| const Input::HatState & | WhichWay | ||
| ) | const |
Gets whether a specific hat is pressed in a specific direction.
| WhichWay | The hat direction to check for. This value is expected to be 1-6. |
Definition at line 139 of file controller.cpp.
|
protectedvirtual |
Internal implementation of the device update.
Implements Mezzanine::Input::ButtonDevice.
Definition at line 69 of file controller.cpp.
|
protectedvirtual |
Implements Mezzanine::Input::ButtonDevice.
Definition at line 103 of file controller.cpp.
|
protected |
Container storing the states for each axis on the controller.
Definition at line 59 of file controller.h.
|
protected |
The name of the controller device.
Definition at line 68 of file controller.h.
|
protected |
Container storing the states for each hat on the controller.
Definition at line 65 of file controller.h.
|
protected |
The index of the controller device.
Definition at line 71 of file controller.h.
|
protected |
Container storing the states for each trackball on the controller.
Definition at line 62 of file controller.h.
1.8.9.1. Thanks to the
Open Icon Library
for help with some of the icons.