Team Fortress 2 Source Code as on 22/4/2020
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

44 lines
1.2 KiB

  1. //========= Copyright Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. // $NoKeywords: $
  6. //===========================================================================//
  7. #ifndef ANALOGCODE_H
  8. #define ANALOGCODE_H
  9. #ifdef _WIN32
  10. #pragma once
  11. #endif
  12. #include "inputsystem/InputEnums.h"
  13. //-----------------------------------------------------------------------------
  14. // Macro to get at joystick codes
  15. //-----------------------------------------------------------------------------
  16. #define JOYSTICK_AXIS_INTERNAL( _joystick, _axis ) ( JOYSTICK_FIRST_AXIS + ((_joystick) * MAX_JOYSTICK_AXES) + (_axis) )
  17. #define JOYSTICK_AXIS( _joystick, _axis ) ( (AnalogCode_t)JOYSTICK_AXIS_INTERNAL( _joystick, _axis ) )
  18. //-----------------------------------------------------------------------------
  19. // Enumeration for analog input devices. Includes joysticks, mousewheel, mouse
  20. //-----------------------------------------------------------------------------
  21. enum AnalogCode_t
  22. {
  23. ANALOG_CODE_INVALID = -1,
  24. MOUSE_X = 0,
  25. MOUSE_Y,
  26. MOUSE_XY, // Invoked when either x or y changes
  27. MOUSE_WHEEL,
  28. JOYSTICK_FIRST_AXIS,
  29. JOYSTICK_LAST_AXIS = JOYSTICK_AXIS_INTERNAL( MAX_JOYSTICKS-1, MAX_JOYSTICK_AXES-1 ),
  30. ANALOG_CODE_LAST,
  31. };
  32. #endif // ANALOGCODE_H