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.

42 lines
891 B

  1. //===== Copyright � 1996-2005, Valve Corporation, All rights reserved. ======//
  2. //
  3. // Purpose:
  4. //
  5. // $NoKeywords: $
  6. //
  7. //===========================================================================//
  8. #ifndef KEYBINDINGS_H
  9. #define KEYBINDINGS_H
  10. #ifdef _WIN32
  11. #pragma once
  12. #endif
  13. #include "tier1/utlstring.h"
  14. #include "inputsystem/ButtonCode.h"
  15. class CUtlBuffer;
  16. class CKeyBindings
  17. {
  18. public:
  19. void SetBinding( ButtonCode_t code, const char *pBinding );
  20. void SetBinding( const char *pButtonName, const char *pBinding );
  21. void Unbind( ButtonCode_t code );
  22. void Unbind( const char *pButtonName );
  23. void UnbindAll();
  24. int GetBindingCount() const;
  25. void WriteBindings( CUtlBuffer &buf );
  26. const char *ButtonNameForBinding( const char *pBinding );
  27. const char *GetBindingForButton( ButtonCode_t code );
  28. private:
  29. CUtlString m_KeyInfo[ BUTTON_CODE_LAST ];
  30. };
  31. #endif // KEYBINDINGS_H