Added gamepad guide button.

This commit is contained in:
Branimir Karadzic 2014-12-20 10:38:40 -08:00
parent 3de8b63457
commit 0d20d7e6c8
3 changed files with 7 additions and 0 deletions

View file

@ -164,6 +164,7 @@ namespace entry
GamepadRight,
GamepadBack,
GamepadStart,
GamepadGuide,
Count
};

View file

@ -303,6 +303,7 @@ namespace entry
initTranslateGamepad(SDL_CONTROLLER_BUTTON_DPAD_RIGHT, Key::GamepadRight);
initTranslateGamepad(SDL_CONTROLLER_BUTTON_BACK, Key::GamepadBack);
initTranslateGamepad(SDL_CONTROLLER_BUTTON_START, Key::GamepadStart);
initTranslateGamepad(SDL_CONTROLLER_BUTTON_GUIDE, Key::GamepadGuide);
memset(s_translateGamepadAxis, uint8_t(GamepadAxis::Count), sizeof(s_translateGamepadAxis) );
initTranslateGamepadAxis(SDL_CONTROLLER_AXIS_LEFTX, GamepadAxis::LeftX);

View file

@ -19,6 +19,10 @@
#include <windowsx.h>
#include <xinput.h>
#ifndef XINPUT_GAMEPAD_GUIDE
# define XINPUT_GAMEPAD_GUIDE 0x400
#endif // XINPUT_GAMEPAD_GUIDE
namespace entry
{
typedef DWORD (WINAPI* PFN_XINPUT_GET_STATE)(DWORD dwUserIndex, XINPUT_STATE* pState);
@ -45,6 +49,7 @@ namespace entry
{ XINPUT_GAMEPAD_RIGHT_THUMB, Key::GamepadThumbR },
{ XINPUT_GAMEPAD_LEFT_SHOULDER, Key::GamepadShoulderL },
{ XINPUT_GAMEPAD_RIGHT_SHOULDER, Key::GamepadShoulderR },
{ XINPUT_GAMEPAD_GUIDE, Key::GamepadGuide },
{ XINPUT_GAMEPAD_A, Key::GamepadA },
{ XINPUT_GAMEPAD_B, Key::GamepadB },
{ XINPUT_GAMEPAD_X, Key::GamepadX },