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.

39 lines
1.3 KiB

  1. //===== Copyright � 1996-2005, Valve Corporation, All rights reserved. ======//
  2. //
  3. // Purpose:
  4. //
  5. //===========================================================================//
  6. #ifndef KEY_TRANSLATION_H
  7. #define KEY_TRANSLATION_H
  8. #ifdef _WIN32
  9. #pragma once
  10. #endif
  11. #include "inputsystem/ButtonCode.h"
  12. #include "inputsystem/AnalogCode.h"
  13. // Call this to initialize the system
  14. void ButtonCode_InitKeyTranslationTable();
  15. // Convert from Windows scan codes to Button codes.
  16. ButtonCode_t ButtonCode_ScanCodeToButtonCode( int lParam );
  17. // Update scan codes for foreign keyboards
  18. void ButtonCode_UpdateScanCodeLayout( );
  19. // Convert from Windows virtual key codes to Button codes.
  20. ButtonCode_t ButtonCode_VirtualKeyToButtonCode( int keyCode );
  21. int ButtonCode_ButtonCodeToVirtualKey( ButtonCode_t code );
  22. ButtonCode_t ButtonCode_XKeyToButtonCode( int nPort, int keyCode );
  23. ButtonCode_t ButtonCode_SKeyToButtonCode( int nPort, int keyCode );
  24. // Convert back + forth between ButtonCode/AnalogCode + strings
  25. const char *ButtonCode_ButtonCodeToString( ButtonCode_t code, bool bXController );
  26. const char *AnalogCode_AnalogCodeToString( AnalogCode_t code );
  27. ButtonCode_t ButtonCode_StringToButtonCode( const char *pString, bool bXController );
  28. AnalogCode_t AnalogCode_StringToAnalogCode( const char *pString );
  29. #endif // KEY_TRANSLATION_H