src/gamepad.cpp
const char* GetButtonName(const Uint8& pButton)
	{
		if (pButton == GAMEPAD_BUTTON_LTRIGGER) return GAMEPAD_BUTTON_LTRIGGER_NAME;
		if (pButton == GAMEPAD_BUTTON_RTRIGGER) return GAMEPAD_BUTTON_RTRIGGER_NAME;

		if (pButton == GAMEPAD_BUTTON_LSTICK_UP) return GAMEPAD_BUTTON_LSTICK_UP_NAME;
		if (pButton == GAMEPAD_BUTTON_LSTICK_DOWN) return GAMEPAD_BUTTON_LSTICK_DOWN_NAME;
		if (pButton == GAMEPAD_BUTTON_LSTICK_LEFT) return GAMEPAD_BUTTON_LSTICK_LEFT_NAME;
		if (pButton == GAMEPAD_BUTTON_LSTICK_RIGHT) return GAMEPAD_BUTTON_LSTICK_RIGHT_NAME;

		if (pButton == GAMEPAD_BUTTON_RSTICK_UP) return GAMEPAD_BUTTON_RSTICK_UP_NAME;
		if (pButton == GAMEPAD_BUTTON_RSTICK_DOWN) return GAMEPAD_BUTTON_RSTICK_DOWN_NAME;
		if (pButton == GAMEPAD_BUTTON_RSTICK_LEFT) return GAMEPAD_BUTTON_RSTICK_LEFT_NAME;
		if (pButton == GAMEPAD_BUTTON_RSTICK_RIGHT) return GAMEPAD_BUTTON_RSTICK_RIGHT_NAME;

		return SDL_GameControllerGetStringForButton((SDL_GameControllerButton)pButton);
	}
//-----------------------------------------------------------------------------
// Purpose: Get the string name of the button.
//-----------------------------------------------------------------------------
Get the string name of the button.
Get the string name of the button .
const char* GetButtonName(const Uint8& pButton)
	{
		if (pButton == GAMEPAD_BUTTON_LTRIGGER) return GAMEPAD_BUTTON_LTRIGGER_NAME;
		if (pButton == GAMEPAD_BUTTON_RTRIGGER) return GAMEPAD_BUTTON_RTRIGGER_NAME;
		if (pButton == GAMEPAD_BUTTON_LSTICK_UP) return GAMEPAD_BUTTON_LSTICK_UP_NAME;
		if (pButton == GAMEPAD_BUTTON_LSTICK_DOWN) return GAMEPAD_BUTTON_LSTICK_DOWN_NAME;
		if (pButton == GAMEPAD_BUTTON_LSTICK_LEFT) return GAMEPAD_BUTTON_LSTICK_LEFT_NAME;
		if (pButton == GAMEPAD_BUTTON_LSTICK_RIGHT) return GAMEPAD_BUTTON_LSTICK_RIGHT_NAME;
		if (pButton == GAMEPAD_BUTTON_RSTICK_UP) return GAMEPAD_BUTTON_RSTICK_UP_NAME;
		if (pButton == GAMEPAD_BUTTON_RSTICK_DOWN) return GAMEPAD_BUTTON_RSTICK_DOWN_NAME;
		if (pButton == GAMEPAD_BUTTON_RSTICK_LEFT) return GAMEPAD_BUTTON_RSTICK_LEFT_NAME;
		if (pButton == GAMEPAD_BUTTON_RSTICK_RIGHT) return GAMEPAD_BUTTON_RSTICK_RIGHT_NAME;
		return SDL_GameControllerGetStringForButton((SDL_GameControllerButton)pButton);
	}
const char * GetButtonName ( const Uint8 & pButton ) { if ( pButton == GAMEPAD_BUTTON_LTRIGGER ) return GAMEPAD_BUTTON_LTRIGGER_NAME ; if ( pButton == GAMEPAD_BUTTON_RTRIGGER ) return GAMEPAD_BUTTON_RTRIGGER_NAME ; if ( pButton == GAMEPAD_BUTTON_LSTICK_UP ) return GAMEPAD_BUTTON_LSTICK_UP_NAME ; if ( pButton == GAMEPAD_BUTTON_LSTICK_DOWN ) return GAMEPAD_BUTTON_LSTICK_DOWN_NAME ; if ( pButton == GAMEPAD_BUTTON_LSTICK_LEFT ) return GAMEPAD_BUTTON_LSTICK_LEFT_NAME ; if ( pButton == GAMEPAD_BUTTON_LSTICK_RIGHT ) return GAMEPAD_BUTTON_LSTICK_RIGHT_NAME ; if ( pButton == GAMEPAD_BUTTON_RSTICK_UP ) return GAMEPAD_BUTTON_RSTICK_UP_NAME ; if ( pButton == GAMEPAD_BUTTON_RSTICK_DOWN ) return GAMEPAD_BUTTON_RSTICK_DOWN_NAME ; if ( pButton == GAMEPAD_BUTTON_RSTICK_LEFT ) return GAMEPAD_BUTTON_RSTICK_LEFT_NAME ; if ( pButton == GAMEPAD_BUTTON_RSTICK_RIGHT ) return GAMEPAD_BUTTON_RSTICK_RIGHT_NAME ; return SDL_GameControllerGetStringForButton ( ( SDL_GameControllerButton ) pButton ) ; }
Purpose: Get the string name of the button.
Purpose : Get the string name of the button .