r5sdk/r5dev/public/inputsystem/AnalogCode.h
Kawe Mazidjatari b72f02d123 InputSystem: fixup enumerants and controller structs
Enumerants:
* ButtonCode_t::JOYSTICK_MAX_BUTTON_COUNT = 32 (previously 26, incorrect...).
* AnalogCode_t::JOYSTICK_FIRST_AXIS = 2 (previously 4, incorrect...).
* Added: ButtonCode_t::KEY_CREDITSIGN (k104, last key).
* Fixed up Xbox controller enums.

Structs xdevice_t:
* Added partially reversed unkownhiddevice_t structure (used for non-xbox hardware).

General:
* Added static assertions for structure sizes.
2024-04-05 17:10:58 +02:00

37 lines
1.2 KiB
C
Raw Blame History

//===== Copyright <20> 1996-2005, Valve Corporation, All rights reserved. ======//
//
// Purpose:
//
// $NoKeywords: $
//===========================================================================//
#ifndef ANALOGCODE_H
#define ANALOGCODE_H
#include "inputsystem/InputEnums.h"
//-----------------------------------------------------------------------------
// Macro to get at joystick codes
//-----------------------------------------------------------------------------
#define JOYSTICK_AXIS_INTERNAL( _joystick, _axis ) ( JOYSTICK_FIRST_AXIS + ((_joystick) * MAX_JOYSTICK_AXES) + (_axis) )
#define JOYSTICK_AXIS( _joystick, _axis ) ( (AnalogCode_t)JOYSTICK_AXIS_INTERNAL( _joystick, _axis ) )
//-----------------------------------------------------------------------------
// Enumeration for analog input devices. Includes joysticks, mousewheel, mouse
//-----------------------------------------------------------------------------
enum AnalogCode_t
{
ANALOG_CODE_INVALID = -1,
MOUSE_XY = 0, // Invoked when either x or y changes
MOUSE_WHEEL,
JOYSTICK_FIRST_AXIS,
JOYSTICK_LAST_AXIS = JOYSTICK_AXIS_INTERNAL(MAX_JOYSTICKS - 1, MAX_JOYSTICK_AXES - 1),
ANALOG_CODE_LAST,
};
#endif // ANALOGCODE_H