How to add SDL_joyscitck fountains?

I discovered the classic game of the captain's claw and I want to add the function that can be played with the joystick.

#include "ActorController.h"
#include "Engine / Scene / SceneNodes.h"
#include "Engine / Events / EventMgr.h"
#include "Engine / Events / Events.h"
#include "ClawEvents.h"
#include "Engine / GameApp / BaseGameApp.h"

ActorController :: ActorController (shared_ptr) Controlled object, flotation speed)
{
m_pControlledObject = controlledObject;
m_Speed ​​= speed;
m_pKeyStates = NULL;
m_MouseLeftButtonDown = m_MouseRightButtonDown = false;
}

void ActorController :: HandleAction (ActionType actionType)
{
switch (type of action)
{
ActionType_Fire case:
{
shared_ptr pClimbEvent (new EventData_Actor_Fire (m_pControlledObject-> VGetProperties () -> GetActorId ()));
IEventMgr :: Get () -> VTriggerEvent (pClimbEvent);
break;
}
ActionType_Attack case:
{
shared_ptr pClimbEvent (new EventData_Actor_Attack (m_pControlledObject-> VGetProperties () -> GetActorId ()));
IEventMgr :: Get () -> VTriggerEvent (pClimbEvent);
break;
}
ActionType_Change_Ammo_Type case:
{
shared_ptr pEvent (new EventData_Request_Change_Ammo_Type (m_pControlledObject-> VGetProperties () -> GetActorId ()));
IEventMgr :: Get () -> VTriggerEvent (pEvent);
break;
}
}
}

void ActorController :: OnUpdate (uint32 msDiff)
{
int account
SDL_PumpEvents ();
m_pKeyStates = SDL_GetKeyboardState (& count);

floating motionX = 0.0f;
floating movement Y = 0.0f;

floating rise Y = 0.0f;

// We need two conditions because I want a behavior like the right and left
// the buttons are pressed, I do not want the actor to move, for example. have the nullyfied movement effect

if (g_pApp-> GetGlobalOptions () -> useAlternateControls)
{
if (m_InputKeys[SDLK_d])
{
moveX + = m_Speed ​​* (float) msDiff;
}
if (m_InputKeys[SDLK_a])
{
moveX - = m_Speed ​​* (float) msDiff;
}

// climbing
if (m_InputKeys[SDLK_s])
{
uploadY + = 5.0;
}
if (m_InputKeys[SDLK_w])
{
climbY - = 5.0;
}

// jumping
if (m_InputKeys[SDLK_SPACE] || m_InputKeys[SDLK_w])
{
moveY - = m_Speed ​​* (float) msDiff;
}
}
plus
{
if (m_InputKeys[SDLK_RIGHT])
{
moveX + = m_Speed ​​* (float) msDiff;
}
if (m_InputKeys[SDLK_LEFT])
{
moveX - = m_Speed ​​* (float) msDiff;
}

// climbing
if (m_InputKeys[SDLK_DOWN])
{
uploadY + = 5.0;
}
if (m_InputKeys[SDLK_UP])
{
climbY - = 5.0;
}

// jumping
if (m_InputKeys[SDLK_SPACE])
{
moveY - = m_Speed ​​* (float) msDiff;
}
}

if (fabs (climbY)> FLT_EPSILON)
{
shared_ptr pClimbEvent (new EventData_Start_Climb (m_pControlledObject-> VGetProperties () -> GetActorId (), Point (0, climbY)));
IEventMgr :: Get () -> VTriggerEvent (pClimbEvent);
}
if (fabs (moveX)> FLT_EPSILON || fabs (moveY)> FLT_EPSILON)
{
shared_ptr pMoveEvent (new EventData_Actor_Start_Move (m_pControlledObject-> VGetProperties () -> GetActorId (), Point (moveX, moveY)));
IEventMgr :: Get () -> VTriggerEvent (pMoveEvent);
}
}

bool ActorController :: VOnKeyDown (key SDL_Keycode)
{
if (g_pApp-> GetGlobalOptions () -> useAlternateControls)
{
if (key == SDLK_e)
{
HandleAction (ActionType_Change_Ammo_Type);
true returns
}
else if (SDL_GetScancodeFromKey (key) == SDL_SCANCODE_F)
{
HandleAction (ActionType_Change_Ammo_Type);
true returns
}
}
plus
{
if (SDL_GetScancodeFromKey (key) == SDL_SCANCODE_H)
{
HandleAction (ActionType_Fire);
true returns
}
else if (SDL_GetScancodeFromKey (key) == SDL_SCANCODE_G)
{
HandleAction (ActionType_Attack);
true returns
}
else if (SDL_GetScancodeFromKey (key) == SDL_SCANCODE_F)
{
HandleAction (ActionType_Change_Ammo_Type);
true returns
}
}

m_InputKeys[key] = true;

false return;
}

bool ActorController :: VOnKeyUp (key SDL_Keycode)
{
if (g_pApp-> GetGlobalOptions () -> useAlternateControls)
{

}
plus
{
if (SDL_GetScancodeFromKey (key) == SDL_SCANCODE_O)
{
shared_ptr pFireEndedEvent (new EventData_Actor_Fire_Ended (m_pControlledObject-> VGetProperties () -> GetActorId ()));
IEventMgr :: Get () -> VTriggerEvent (pFireEndedEvent);

true returns
}
}

m_InputKeys[key] = false;
false return;
}

bool ActorController :: VOnPointerMove (SDL_MouseMotionEvent & mouseEvent)
{
false return;
}

bool ActorController :: VOnPointerButtonDown (SDL_MouseButtonEvent & mouseEvent)
{
if (mouseEvent.button == SDL_BUTTON_LEFT)
{
m_MouseLeftButtonDown = true;

if (g_pApp-> GetGlobalOptions () -> useAlternateControls)
{
HandleAction (ActionType_Fire);
}

true returns
}
else if (mouseEvent.button == SDL_BUTTON_RIGHT)
{
m_MouseRightButtonDown = true;

if (g_pApp-> GetGlobalOptions () -> useAlternateControls)
{
HandleAction (ActionType_Attack);
}

true returns
}

false return;
}

bool ActorController :: VOnPointerButtonUp (SDL_MouseButtonEvent & mouseEvent)
{
if (mouseEvent.button == SDL_BUTTON_LEFT)
{
shared_ptr pFireEndedEvent (new EventData_Actor_Fire_Ended (m_pControlledObject-> VGetProperties () -> GetActorId ()));
IEventMgr :: Get () -> VTriggerEvent (pFireEndedEvent);

m_MouseLeftButtonDown = false;
true returns
}
else if (mouseEvent.button == SDL_BUTTON_RIGHT)
{
m_MouseRightButtonDown = false;
true returns
}

false return;
}