This is a base class for all input devices with buttons. More...
#include <buttondevice.h>
Inheritance diagram for Mezzanine::Input::ButtonDevice:
Collaboration diagram for Mezzanine::Input::ButtonDevice:Public Member Functions | |||
| 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... | |||
| virtual const Input::ButtonState & | GetButtonState (const UInt16 Button) const =0 | ||
| Gets the state of the requested button. More... | |||
| virtual const Input::ButtonState & | GetButtonState (const Input::InputCode &Button) const =0 | ||
| Gets the state of the requested button. 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.
| |||
| virtual UInt16 | GetDeviceIndex () const =0 | ||
| Gets the device index of this controller. More... | |||
| 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 =0 |
| Adds MetaCodes belonging to all the buttons that are currently pressed for this device. More... | |
| void | UpdateButtonTransitions () |
| Updates transitioning buttons. More... | |
| virtual void | UpdateImpl (const MetaCodeContainer &DeltaCodes, MetaCodeContainer &GeneratedCodes)=0 |
| Internal implementation of the device update. More... | |
| virtual void | VerifySequenceImpl (const MetaCodeContainer &Sequence) const =0 |
Protected Attributes | |
| 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 is a base class for all input devices with buttons.
Definition at line 53 of file buttondevice.h.
|
virtual |
Updates this device with the newest data.
| DeltaCodes | A vector of the codes to process and update this device with. |
| GeneratedCodes | A vector to which generated codes (sequence or otherwise) will be added. |
Implements Mezzanine::Input::Device.
Definition at line 110 of file buttondevice.cpp.
|
protectedpure virtual |
Adds MetaCodes belonging to all the buttons that are currently pressed for this device.
Implemented in Mezzanine::Input::Mouse, Mezzanine::Input::Controller, and Mezzanine::Input::Keyboard.
| Boole Mezzanine::Input::ButtonDevice::CheckButtonState | ( | const UInt16 | Button, |
| const Input::ButtonState & | State | ||
| ) | const |
Checks to see if a button on this device is a specific state.
| Button | The button to check the state of. |
| State | The button state to check for. |
Definition at line 104 of file buttondevice.cpp.
| Boole Mezzanine::Input::ButtonDevice::CheckButtonState | ( | const Input::InputCode & | Button, |
| const Input::ButtonState & | State | ||
| ) | const |
Checks to see if a button on this device is a specific state.
| Button | The button to check the state of. |
| State | The button state to check for. |
Definition at line 107 of file buttondevice.cpp.
|
pure virtual |
Gets the state of the requested button.
Implemented in Mezzanine::Input::Mouse, Mezzanine::Input::Controller, and Mezzanine::Input::Keyboard.
|
pure virtual |
Gets the state of the requested button.
Implemented in Mezzanine::Input::Mouse, Mezzanine::Input::Controller, and Mezzanine::Input::Keyboard.
| UInt16 Mezzanine::Input::ButtonDevice::GetNumButtons | ( | ) | const |
Gets the number of buttons on this device.
Definition at line 71 of file buttondevice.cpp.
Gets whether or not a device button was lifted this frame.
| Button | The button to check the state of. |
Definition at line 86 of file buttondevice.cpp.
| Boole Mezzanine::Input::ButtonDevice::IsButtonLifting | ( | const Input::InputCode & | Button | ) | const |
Gets whether or not a device button was lifted this frame.
| Button | The button to check the state of. |
Definition at line 89 of file buttondevice.cpp.
Gets whether or not a device button is pressed down.
| Button | The button to check the state of. |
Definition at line 74 of file buttondevice.cpp.
| Boole Mezzanine::Input::ButtonDevice::IsButtonPressed | ( | const Input::InputCode & | Button | ) | const |
Gets whether or not a device button is pressed down.
| Button | The button to check the state of. |
Definition at line 77 of file buttondevice.cpp.
Gets whether or not a device button was pressed this frame.
| Button | The button to check the state of. |
Definition at line 80 of file buttondevice.cpp.
| Boole Mezzanine::Input::ButtonDevice::IsButtonPressing | ( | const Input::InputCode & | Button | ) | const |
Gets whether or not a device button was pressed this frame.
| Button | The button to check the state of. |
Definition at line 83 of file buttondevice.cpp.
Gets whether or not a device button was lifted or pressed this frame.
| Button | The button to check the state of. |
Definition at line 92 of file buttondevice.cpp.
| Boole Mezzanine::Input::ButtonDevice::IsButtonTransitioning | ( | const Input::ButtonState & | Button | ) | const |
Gets whether or not a device button was lifted or pressed this frame.
| Button | The button to check the state of. |
Definition at line 98 of file buttondevice.cpp.
|
protected |
Updates transitioning buttons.
Definition at line 55 of file buttondevice.cpp.
|
protectedpure virtual |
Internal implementation of the device update.
Implemented in Mezzanine::Input::Mouse, Mezzanine::Input::Controller, and Mezzanine::Input::Keyboard.
|
protectedpure virtual |
Implements Mezzanine::Input::Device.
Implemented in Mezzanine::Input::Mouse, Mezzanine::Input::Controller, and Mezzanine::Input::Keyboard.
|
protected |
A container of states for each button on the input device.
Definition at line 61 of file buttondevice.h.
|
protected |
A container of indexes being tracked due to state transitions.
Definition at line 58 of file buttondevice.h.
1.8.9.1. Thanks to the
Open Icon Library
for help with some of the icons.