Counter Strike : Global Offensive Source Code
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.

46 lines
902 B

  1. //========= Copyright � 1996-2005, Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. // $NoKeywords: $
  6. //=============================================================================//
  7. #ifndef KEYREPEAT_H
  8. #define KEYREPEAT_H
  9. #ifdef _WIN32
  10. #pragma once
  11. #endif
  12. #include "inputsystem/buttoncode.h"
  13. enum KEYREPEAT_ALIASES
  14. {
  15. KR_ALIAS_UP,
  16. KR_ALIAS_DOWN,
  17. KR_ALIAS_LEFT,
  18. KR_ALIAS_RIGHT,
  19. FM_NUM_KEYREPEAT_ALIASES,
  20. };
  21. class CKeyRepeatHandler
  22. {
  23. public:
  24. CKeyRepeatHandler();
  25. void Reset();
  26. void KeyDown( ButtonCode_t code );
  27. void KeyUp( ButtonCode_t code );
  28. ButtonCode_t KeyRepeated();
  29. void SetKeyRepeatTime( ButtonCode_t code, float flRepeat );
  30. private:
  31. bool m_bAliasDown[MAX_JOYSTICKS][FM_NUM_KEYREPEAT_ALIASES];
  32. float m_flRepeatTimes[FM_NUM_KEYREPEAT_ALIASES];
  33. float m_flNextKeyRepeat[MAX_JOYSTICKS];
  34. bool m_bHaveKeyDown;
  35. };
  36. #endif // KEYREPEAT_H