Urho3D::JoystickState Struct Reference

Input state for a joystick. More...

#include <Input.h>

Collaboration diagram for Urho3D::JoystickState:

Public Member Functions

 JoystickState ()
 Construct with defaults.
void Initialize (unsigned numButtons, unsigned numAxes, unsigned numHats)
 Initialize the number of buttons, axes and hats and set them to neutral state.
void Reset ()
 Reset button, axis and hat states to neutral.
bool IsController () const
 Return whether is a game controller. Game controllers will use standardized axis and button mappings.
unsigned GetNumButtons () const
 Return number of buttons.
unsigned GetNumAxes () const
 Return number of axes.
unsigned GetNumHats () const
 Return number of hats.
bool GetButtonDown (unsigned index) const
 Check if a button is held down.
bool GetButtonPress (unsigned index) const
 Check if a button has been pressed on this frame.
float GetAxisPosition (unsigned index) const
 Return axis position.
int GetHatPosition (unsigned index) const
 Return hat position.

Public Attributes

SDL_Joystick * joystick_
 SDL joystick.
SDL_JoystickID joystickID_
 SDL joystick instance ID.
SDL_GameController * controller_
 SDL game controller.
 UI element containing the screen joystick.
String name_
 Joystick name.
PODVector< bool > buttons_
 Button up/down state.
PODVector< bool > buttonPress_
 Button pressed on this frame.
PODVector< float > axes_
 Axis position from -1 to 1.
PODVector< int > hats_
 POV hat bits.

Detailed Description

Input state for a joystick.

The documentation for this struct was generated from the following files:
  • /home/travis/build/urho3d/Urho3D/Source/Urho3D/Input/Input.h
  • /home/travis/build/urho3d/Urho3D/Source/Urho3D/Input/Input.cpp