Annwvyn::AnnControllerEvent Class Reference

A joystick event. More...

#include <AnnEvents.hpp>

Inheritance diagram for Annwvyn::AnnControllerEvent:
Collaboration diagram for Annwvyn::AnnControllerEvent:

Public Member Functions

 AnnControllerEvent ()
 Construct a stick event object. More...
 
 ~AnnControllerEvent ()
 Destroy a stick event object. More...
 
size_t getNbButtons () const
 Number of buttons this controller has. More...
 
std::vector< unsigned short > getPressed () const
 Get the list of pressed buttons. More...
 
std::vector< unsigned short > getReleased () const
 Get the list of released buttons. More...
 
bool isPressed (ButtonId id)
 Return true if this button just have been pressed. More...
 
bool isReleased (ButtonId id)
 Return true if this button just have been released. More...
 
bool isDown (ButtonId id)
 Return true if this button is currently pressed. More...
 
AnnControllerAxis getAxis (ControllerAxisID ax)
 Get the axis object for this ID. More...
 
size_t getAxisCount () const
 Get the number of axes the controller has. More...
 
ControllerID getControllerID () const
 Get the unique ID given by Annwvyn for this stick. More...
 
std::string getVendor () const
 Get the "vendor string" of this joystick (could be its name) More...
 
size_t getPovCount () const
 Get the number of PoV controller on this one. More...
 
AnnControllerPov getPov (PovId pov)
 Get the PoV corresponding to this ID. More...
 
bool isXboxController () const
 Return true if this event is from an Xbox controller. More...
 
- Public Member Functions inherited from Annwvyn::AnnEvent
 AnnEvent ()
 Event constructor. More...
 
AnnEventType getType () const
 

Private Attributes

bool xbox
 set to true if this is an Xbox controller (We're not using Xinput tho) More...
 
std::vector< bytebuttons
 Button array. More...
 
std::vector< AnnControllerAxisaxes
 Axis array. More...
 
std::vector< AnnControllerPovpovs
 Pov Array. More...
 
std::vector< unsigned short > pressed
 Pressed event "queue". More...
 
std::vector< unsigned short > released
 Released event "queue". More...
 
std::string vendor
 Joystick "vendor" name (generally the brand and model) More...
 
int stickID
 Joystick ID for the engine. More...
 

Friends

class AnnEventManager
 

Additional Inherited Members

- Protected Attributes inherited from Annwvyn::AnnEvent
AnnEventType type
 

Detailed Description

A joystick event.

Definition at line 240 of file AnnEvents.hpp.

Constructor & Destructor Documentation

◆ AnnControllerEvent()

AnnControllerEvent::AnnControllerEvent ( )

Construct a stick event object.

Definition at line 302 of file AnnEvents.cpp.

◆ ~AnnControllerEvent()

AnnControllerEvent::~AnnControllerEvent ( )

Destroy a stick event object.

Definition at line 310 of file AnnEvents.cpp.

Member Function Documentation

◆ getAxis()

AnnControllerAxis AnnControllerEvent::getAxis ( ControllerAxisID  ax)

Get the axis object for this ID.

Definition at line 338 of file AnnEvents.cpp.

◆ getAxisCount()

size_t AnnControllerEvent::getAxisCount ( ) const

Get the number of axes the controller has.

Definition at line 343 of file AnnEvents.cpp.

◆ getControllerID()

ControllerID AnnControllerEvent::getControllerID ( ) const

Get the unique ID given by Annwvyn for this stick.

Definition at line 312 of file AnnEvents.cpp.

◆ getNbButtons()

size_t AnnControllerEvent::getNbButtons ( ) const

Number of buttons this controller has.

Definition at line 323 of file AnnEvents.cpp.

Here is the call graph for this function:

◆ getPov()

AnnControllerPov AnnControllerEvent::getPov ( PovId  pov)

Get the PoV corresponding to this ID.

Definition at line 373 of file AnnEvents.cpp.

Here is the call graph for this function:

◆ getPovCount()

size_t AnnControllerEvent::getPovCount ( ) const

Get the number of PoV controller on this one.

Definition at line 386 of file AnnEvents.cpp.

Here is the caller graph for this function:

◆ getPressed()

std::vector< unsigned short > AnnControllerEvent::getPressed ( ) const

Get the list of pressed buttons.

Definition at line 328 of file AnnEvents.cpp.

◆ getReleased()

std::vector< unsigned short > AnnControllerEvent::getReleased ( ) const

Get the list of released buttons.

Definition at line 333 of file AnnEvents.cpp.

◆ getVendor()

std::string AnnControllerEvent::getVendor ( ) const

Get the "vendor string" of this joystick (could be its name)

Definition at line 368 of file AnnEvents.cpp.

◆ isDown()

bool AnnControllerEvent::isDown ( ButtonId  id)

Return true if this button is currently pressed.

Definition at line 317 of file AnnEvents.cpp.

Here is the call graph for this function:

◆ isPressed()

bool AnnControllerEvent::isPressed ( ButtonId  id)

Return true if this button just have been pressed.

Definition at line 348 of file AnnEvents.cpp.

Here is the call graph for this function:

◆ isReleased()

bool AnnControllerEvent::isReleased ( ButtonId  id)

Return true if this button just have been released.

Definition at line 358 of file AnnEvents.cpp.

Here is the call graph for this function:

◆ isXboxController()

bool AnnControllerEvent::isXboxController ( ) const

Return true if this event is from an Xbox controller.

Definition at line 381 of file AnnEvents.cpp.

Friends And Related Function Documentation

◆ AnnEventManager

friend class AnnEventManager
friend

Definition at line 281 of file AnnEvents.hpp.

Member Data Documentation

◆ axes

std::vector<AnnControllerAxis> Annwvyn::AnnControllerEvent::axes
private

Axis array.

Definition at line 285 of file AnnEvents.hpp.

◆ buttons

std::vector<byte> Annwvyn::AnnControllerEvent::buttons
private

Button array.

Definition at line 283 of file AnnEvents.hpp.

◆ povs

std::vector<AnnControllerPov> Annwvyn::AnnControllerEvent::povs
private

Pov Array.

Definition at line 287 of file AnnEvents.hpp.

◆ pressed

std::vector<unsigned short> Annwvyn::AnnControllerEvent::pressed
private

Pressed event "queue".

Definition at line 289 of file AnnEvents.hpp.

◆ released

std::vector<unsigned short> Annwvyn::AnnControllerEvent::released
private

Released event "queue".

Definition at line 291 of file AnnEvents.hpp.

◆ stickID

int Annwvyn::AnnControllerEvent::stickID
private

Joystick ID for the engine.

Definition at line 295 of file AnnEvents.hpp.

◆ vendor

std::string Annwvyn::AnnControllerEvent::vendor
private

Joystick "vendor" name (generally the brand and model)

Definition at line 293 of file AnnEvents.hpp.

◆ xbox

bool Annwvyn::AnnControllerEvent::xbox
private

set to true if this is an Xbox controller (We're not using Xinput tho)

Definition at line 280 of file AnnEvents.hpp.


The documentation for this class was generated from the following files: