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.

47 lines
877 B

  1. //====== Copyright � 1996-2005, Valve Corporation, All rights reserved. =======
  2. //
  3. // Purpose:
  4. //
  5. //=============================================================================
  6. #ifndef KEYREPEAT_H
  7. #define KEYREPEAT_H
  8. #ifdef _WIN32
  9. #pragma once
  10. #endif
  11. namespace vgui
  12. {
  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( vgui::KeyCode code );
  27. void KeyUp( vgui::KeyCode code );
  28. vgui::KeyCode KeyRepeated();
  29. void SetKeyRepeatTime( vgui::KeyCode 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. } // namespace vgui
  37. #endif // KEYREPEAT_H