mirror of
https://github.com/scratchfoundation/bgfx.git
synced 2024-11-28 10:35:43 -05:00
Added gamepad guide button.
This commit is contained in:
parent
3de8b63457
commit
0d20d7e6c8
3 changed files with 7 additions and 0 deletions
|
@ -164,6 +164,7 @@ namespace entry
|
|||
GamepadRight,
|
||||
GamepadBack,
|
||||
GamepadStart,
|
||||
GamepadGuide,
|
||||
|
||||
Count
|
||||
};
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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 },
|
||||
|
|
Loading…
Reference in a new issue