PixelLightAPI
.
|
Input controller. More...
#include <Controller.h>
Public Member Functions | |
PLINPUT_API | Controller (EControllerType nType, const PLCore::String &sName, const PLCore::String &sDescription) |
Constructor. | |
virtual PLINPUT_API | ~Controller () |
Destructor. | |
PLINPUT_API EControllerType | GetType () const |
Get controller type. | |
PLINPUT_API PLCore::String | GetName () const |
Get controller name. | |
PLINPUT_API PLCore::String | GetDescription () const |
Get controller description. | |
PLINPUT_API bool | GetActive () const |
Check if controller is active. | |
PLINPUT_API void | SetActive (bool bActive) |
Activate or deactivate controller. | |
PLINPUT_API bool | HasChanged () const |
Check if the controller's state has changed (for polling) | |
PLINPUT_API const PLCore::List < Control * > & | GetControls () const |
Get all controls of the controller. | |
PLINPUT_API const PLCore::List < Button * > & | GetButtons () const |
Get all buttons. | |
PLINPUT_API const PLCore::List < Axis * > & | GetAxes () const |
Get all axes. | |
PLINPUT_API Control * | GetControl (const PLCore::String &sName) const |
Get control with a specific name. | |
PLINPUT_API char | GetChar () |
Get character of last button that was hit. | |
PLINPUT_API const PLCore::List < Connection * > & | GetConnections () |
Get connections. | |
PLINPUT_API void | Connect (const PLCore::String &sControl, Control *pControl, float fScale=1.0f) |
Connect to another controller. | |
PLINPUT_API void | ConnectAll (Controller *pController, const PLCore::String &sPrefixOut, const PLCore::String &sPrefixIn) |
Connect to another controller. | |
PLINPUT_API void | Disconnect (Connection *pConnection) |
Disconnect connection. | |
virtual PLINPUT_API void | Update () |
Update device once per frame. | |
virtual PLINPUT_API void | UpdateOutputControl (Control *pControl) |
Update output controls (LEDs, effects etc.) | |
Protected Member Functions | |
PLINPUT_API void | AddControl (Control *pControl) |
Add control. | |
PLINPUT_API void | InformControl (Control *pControl) |
Inform controller that a control has changed it's state. | |
PLINPUT_API void | InitControlList (EControlType nType) const |
Init control list. | |
PLINPUT_API void | AddConnection (Connection *pConnection) |
Add connection. | |
PLINPUT_API void | RemoveConnection (Connection *pConnection) |
Remove connection. | |
Protected Attributes | |
EControllerType | m_nType |
PLCore::String | m_sName |
PLCore::String | m_sDescription |
bool | m_bConfirmed |
bool | m_bActive |
bool | m_bChanged |
PLCore::List< Control * > | m_lstControls |
PLCore::HashMap < PLCore::String, Control * > | m_mapControls |
PLCore::List< Button * > | m_lstButtons |
PLCore::List< Axis * > | m_lstAxes |
char | m_nChar |
PLCore::List< Connection * > | m_lstConnections |
Input controller.
PLINPUT_API PLInput::Controller::Controller | ( | EControllerType | nType, |
const PLCore::String & | sName, | ||
const PLCore::String & | sDescription | ||
) |
Constructor.
[in] | nType | Controller type |
[in] | sName | Controller name |
[in] | sDescription | Controller description |
virtual PLINPUT_API PLInput::Controller::~Controller | ( | ) | [virtual] |
Destructor.
PLINPUT_API EControllerType PLInput::Controller::GetType | ( | ) | const |
Get controller type.
PLINPUT_API PLCore::String PLInput::Controller::GetName | ( | ) | const |
Get controller name.
PLINPUT_API PLCore::String PLInput::Controller::GetDescription | ( | ) | const |
Get controller description.
PLINPUT_API bool PLInput::Controller::GetActive | ( | ) | const |
Check if controller is active.
PLINPUT_API void PLInput::Controller::SetActive | ( | bool | bActive | ) |
Activate or deactivate controller.
[in] | bActive | 'true' if controller is active, else 'false' |
PLINPUT_API bool PLInput::Controller::HasChanged | ( | ) | const |
Check if the controller's state has changed (for polling)
PLINPUT_API const PLCore::List<Control*>& PLInput::Controller::GetControls | ( | ) | const |
Get all controls of the controller.
PLINPUT_API const PLCore::List<Button*>& PLInput::Controller::GetButtons | ( | ) | const |
Get all buttons.
PLINPUT_API const PLCore::List<Axis*>& PLInput::Controller::GetAxes | ( | ) | const |
Get all axes.
PLINPUT_API Control* PLInput::Controller::GetControl | ( | const PLCore::String & | sName | ) | const |
Get control with a specific name.
[in] | sName | Name of control |
PLINPUT_API char PLInput::Controller::GetChar | ( | ) |
Get character of last button that was hit.
PLINPUT_API const PLCore::List<Connection*>& PLInput::Controller::GetConnections | ( | ) |
Get connections.
PLINPUT_API void PLInput::Controller::Connect | ( | const PLCore::String & | sControl, |
Control * | pControl, | ||
float | fScale = 1.0f |
||
) |
Connect to another controller.
[in] | sControl | Name of control of this controller (output control) |
[in] | pControl | Pointer to control (input control), shouldn't be a null pointer (but a null pointer is caught internally) |
[in] | fScale | Scale factor |
PLINPUT_API void PLInput::Controller::ConnectAll | ( | Controller * | pController, |
const PLCore::String & | sPrefixOut, | ||
const PLCore::String & | sPrefixIn | ||
) |
Connect to another controller.
[in] | pController | Pointer to controller containing the input controls, shouldn't be a null pointer (but a null pointer is caught internally) |
[in] | sPrefixOut | Prefix for controls of this controller |
[in] | sPrefixIn | Prefix for controls of the other controller |
PLINPUT_API void PLInput::Controller::Disconnect | ( | Connection * | pConnection | ) |
Disconnect connection.
[in] | pConnection | Connection (must be valid!), on successful disconnect, the given "pConnection" instance becomes invalid |
virtual PLINPUT_API void PLInput::Controller::Update | ( | ) | [virtual] |
Update device once per frame.
Reimplemented in PLInput::Keyboard, PLInput::Joystick, PLInput::SensorManager, PLInput::Mouse, and PLInput::SplitTouchPad.
virtual PLINPUT_API void PLInput::Controller::UpdateOutputControl | ( | Control * | pControl | ) | [virtual] |
Update output controls (LEDs, effects etc.)
[in] | pControl | Output control that has been changed, must be valid! |
Reimplemented in PLInput::WiiMote, and PLInput::Joystick.
PLINPUT_API void PLInput::Controller::AddControl | ( | Control * | pControl | ) | [protected] |
Add control.
[in] | pControl | Pointer to control, must be valid! |
PLINPUT_API void PLInput::Controller::InformControl | ( | Control * | pControl | ) | [protected] |
Inform controller that a control has changed it's state.
[in] | pControl | Pointer to control, must be valid! |
PLINPUT_API void PLInput::Controller::InitControlList | ( | EControlType | nType | ) | const [protected] |
Init control list.
[in] | nType | Type of list that is to be filled |
PLINPUT_API void PLInput::Controller::AddConnection | ( | Connection * | pConnection | ) | [protected] |
Add connection.
[in] | pConnection | Connection (must be valid!) |
PLINPUT_API void PLInput::Controller::RemoveConnection | ( | Connection * | pConnection | ) | [protected] |
Remove connection.
[in] | pConnection | Connection (must be valid!) |
EControllerType PLInput::Controller::m_nType [protected] |
Controller type
PLCore::String PLInput::Controller::m_sName [protected] |
Controller name
PLCore::String PLInput::Controller::m_sDescription [protected] |
Controller description
bool PLInput::Controller::m_bConfirmed [protected] |
Confirmation flag for DetectDevices()
bool PLInput::Controller::m_bActive [protected] |
Is the controller active?
bool PLInput::Controller::m_bChanged [mutable, protected] |
Has the controller's state changed?
PLCore::List<Control*> PLInput::Controller::m_lstControls [protected] |
List of all controls
PLCore::HashMap<PLCore::String, Control*> PLInput::Controller::m_mapControls [protected] |
Hash map of name -> control
PLCore::List<Button*> PLInput::Controller::m_lstButtons [mutable, protected] |
List of buttons (filled on use)
PLCore::List<Axis*> PLInput::Controller::m_lstAxes [mutable, protected] |
List of absolute axes (filled on use)
char PLInput::Controller::m_nChar [protected] |
Last hit key character
PLCore::List<Connection*> PLInput::Controller::m_lstConnections [protected] |
List of connections
|