mirror of
https://github.com/Mauler125/r5sdk.git
synced 2025-02-09 19:15:03 +01:00
InputSystem: update button codes
Xbox enumerants have changed as the game supports Xbox One controllers. Since the joystick button count has changed, 'JOYSTICK_MAX_BUTTON_COUNT' has also changed which affects the size of datatypes used by the CInputSystem class.
This commit is contained in:
parent
d608c734bd
commit
953bf9bd0d
@ -1,4 +1,5 @@
|
||||
#pragma once
|
||||
#include "InputEnums.h"
|
||||
|
||||
#define JOYSTICK_BUTTON_INTERNAL( _joystick, _button ) ( JOYSTICK_FIRST_BUTTON + ((_joystick) * JOYSTICK_MAX_BUTTON_COUNT) + (_button) )
|
||||
#define JOYSTICK_POV_BUTTON_INTERNAL( _joystick, _button ) ( JOYSTICK_FIRST_POV_BUTTON + ((_joystick) * JOYSTICK_POV_BUTTON_COUNT) + (_button) )
|
||||
@ -8,27 +9,9 @@
|
||||
#define JOYSTICK_POV_BUTTON( _joystick, _button ) ( (ButtonCode_t)JOYSTICK_POV_BUTTON_INTERNAL( _joystick, _button ) )
|
||||
#define JOYSTICK_AXIS_BUTTON( _joystick, _button ) ( (ButtonCode_t)JOYSTICK_AXIS_BUTTON_INTERNAL( _joystick, _button ) )
|
||||
|
||||
// Buttons are not confirmed to be the same. They have been always the same throughout the source engine. Lets hope they did not change them.
|
||||
enum
|
||||
{
|
||||
MAX_JOYSTICKS = MAX_SPLITSCREEN_CLIENTS,
|
||||
MOUSE_BUTTON_COUNT = 5,
|
||||
};
|
||||
|
||||
enum JoystickAxis_t
|
||||
{
|
||||
JOY_AXIS_X = 0,
|
||||
JOY_AXIS_Y,
|
||||
JOY_AXIS_Z,
|
||||
JOY_AXIS_R,
|
||||
JOY_AXIS_U,
|
||||
JOY_AXIS_V,
|
||||
MAX_JOYSTICK_AXES,
|
||||
};
|
||||
|
||||
enum
|
||||
{
|
||||
JOYSTICK_MAX_BUTTON_COUNT = 32,
|
||||
JOYSTICK_MAX_BUTTON_COUNT = 26,
|
||||
JOYSTICK_POV_BUTTON_COUNT = 4,
|
||||
JOYSTICK_AXIS_BUTTON_COUNT = MAX_JOYSTICK_AXES * 2,
|
||||
};
|
||||
@ -183,11 +166,15 @@ enum ButtonCode_t
|
||||
BUTTON_CODE_LAST,
|
||||
BUTTON_CODE_COUNT = BUTTON_CODE_LAST - KEY_FIRST + 1,
|
||||
|
||||
// Helpers for XBox 360
|
||||
// Helpers for XBox
|
||||
KEY_XBUTTON_UP = JOYSTICK_FIRST_POV_BUTTON, // POV buttons
|
||||
KEY_XBUTTON_RIGHT,
|
||||
KEY_XBUTTON_DOWN,
|
||||
KEY_XBUTTON_LEFT,
|
||||
KEY_XBUTTON_RIGHT,
|
||||
KEY_XBUTTON_START,
|
||||
KEY_XBUTTON_BACK,
|
||||
KEY_XBUTTON_STICK1,
|
||||
KEY_XBUTTON_STICK2,
|
||||
|
||||
KEY_XBUTTON_A = JOYSTICK_FIRST_BUTTON, // Buttons
|
||||
KEY_XBUTTON_B,
|
||||
@ -195,20 +182,19 @@ enum ButtonCode_t
|
||||
KEY_XBUTTON_Y,
|
||||
KEY_XBUTTON_LEFT_SHOULDER,
|
||||
KEY_XBUTTON_RIGHT_SHOULDER,
|
||||
KEY_XBUTTON_BACK,
|
||||
KEY_XBUTTON_START,
|
||||
KEY_XBUTTON_STICK1,
|
||||
KEY_XBUTTON_STICK2,
|
||||
KEY_XBUTTON_INACTIVE_START,
|
||||
|
||||
KEY_XSTICK1_RIGHT = JOYSTICK_FIRST_AXIS_BUTTON, // XAXIS POSITIVE
|
||||
KEY_XSTICK1_LEFT, // XAXIS NEGATIVE
|
||||
KEY_XBUTTON_LTRIGGER_PARTIAL,
|
||||
KEY_XBUTTON_LTRIGGER_FULL,
|
||||
KEY_XBUTTON_RTRIGGER_PARTIAL,
|
||||
KEY_XBUTTON_RTRIGGER_FULL,
|
||||
|
||||
KEY_XSTICK1_UP = JOYSTICK_FIRST_AXIS_BUTTON, // YAXIS NEGATIVE
|
||||
KEY_XSTICK1_DOWN, // YAXIS POSITIVE
|
||||
KEY_XSTICK1_UP, // YAXIS NEGATIVE
|
||||
KEY_XBUTTON_LTRIGGER, // ZAXIS POSITIVE
|
||||
KEY_XBUTTON_RTRIGGER, // ZAXIS NEGATIVE
|
||||
KEY_XSTICK2_RIGHT, // UAXIS POSITIVE
|
||||
KEY_XSTICK2_LEFT, // UAXIS NEGATIVE
|
||||
KEY_XSTICK2_DOWN, // VAXIS POSITIVE
|
||||
KEY_XSTICK1_LEFT, // XAXIS NEGATIVE
|
||||
KEY_XSTICK1_RIGHT, // XAXIS POSITIVE
|
||||
|
||||
KEY_XSTICK2_UP, // VAXIS NEGATIVE
|
||||
};
|
||||
KEY_XSTICK2_DOWN, // VAXIS POSITIVE
|
||||
KEY_XSTICK2_LEFT, // UAXIS NEGATIVE
|
||||
KEY_XSTICK2_RIGHT, // UAXIS POSITIVE
|
||||
};
|
||||
|
@ -6,6 +6,82 @@
|
||||
#ifndef INPUTENUMS_H
|
||||
#define INPUTENUMS_H
|
||||
|
||||
// Standard maximum +/- value of a joystick axis
|
||||
#define MAX_BUTTONSAMPLE 32768
|
||||
|
||||
#if !defined( _X360 )
|
||||
#define INVALID_USER_ID -1
|
||||
#else
|
||||
#define INVALID_USER_ID XBX_INVALID_USER_ID
|
||||
#endif
|
||||
|
||||
enum
|
||||
{
|
||||
#ifdef _PS3
|
||||
MAX_JOYSTICKS = 7,
|
||||
#else
|
||||
MAX_JOYSTICKS = 4,
|
||||
#endif
|
||||
MOUSE_BUTTON_COUNT = 5,
|
||||
MAX_NOVINT_DEVICES = 2,
|
||||
};
|
||||
|
||||
enum JoystickAxis_t
|
||||
{
|
||||
JOY_AXIS_X = 0,
|
||||
JOY_AXIS_Y,
|
||||
JOY_AXIS_Z,
|
||||
JOY_AXIS_R,
|
||||
JOY_AXIS_U,
|
||||
JOY_AXIS_V,
|
||||
MAX_JOYSTICK_AXES,
|
||||
};
|
||||
|
||||
enum JoystickDeadzoneMode_t
|
||||
{
|
||||
JOYSTICK_DEADZONE_CROSS = 0,
|
||||
JOYSTICK_DEADZONE_SQUARE = 1,
|
||||
};
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Events
|
||||
//-----------------------------------------------------------------------------
|
||||
enum InputEventType_t
|
||||
{
|
||||
IE_ButtonPressed = 0, // m_nData contains a ButtonCode_t
|
||||
IE_ButtonReleased, // m_nData contains a ButtonCode_t
|
||||
IE_ButtonDoubleClicked, // m_nData contains a ButtonCode_t
|
||||
IE_AnalogValueChanged, // m_nData contains an AnalogCode_t, m_nData2 contains the value
|
||||
|
||||
IE_FirstSystemEvent = 100,
|
||||
IE_Quit = IE_FirstSystemEvent,
|
||||
IE_ControllerInserted, // m_nData contains the controller ID
|
||||
IE_ControllerUnplugged, // m_nData contains the controller ID
|
||||
IE_Close,
|
||||
IE_WindowSizeChanged, // m_nData contains width, m_nData2 contains height, m_nData3 = 0 if not minimized, 1 if minimized
|
||||
IE_PS_CameraUnplugged, // m_nData contains code for type of disconnect.
|
||||
IE_PS_Move_OutOfView, // m_nData contains bool (0, 1) for whether the move is now out of view (1) or in view (0)
|
||||
|
||||
IE_FirstUIEvent = 200,
|
||||
IE_LocateMouseClick = IE_FirstUIEvent,
|
||||
IE_SetCursor,
|
||||
IE_KeyTyped,
|
||||
IE_KeyCodeTyped,
|
||||
IE_InputLanguageChanged,
|
||||
IE_IMESetWindow,
|
||||
IE_IMEStartComposition,
|
||||
IE_IMEComposition,
|
||||
IE_IMEEndComposition,
|
||||
IE_IMEShowCandidates,
|
||||
IE_IMEChangeCandidates,
|
||||
IE_IMECloseCandidates,
|
||||
IE_IMERecomputeModes,
|
||||
IE_OverlayEvent,
|
||||
|
||||
IE_FirstVguiEvent = 1000, // Assign ranges for other systems that post user events here
|
||||
IE_FirstAppEvent = 2000,
|
||||
};
|
||||
|
||||
struct InputEvent_t
|
||||
{
|
||||
const char* m_pCommand;
|
||||
|
Loading…
x
Reference in New Issue
Block a user