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.

38 lines
1.3 KiB

  1. //========= Copyright 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. // Convert back + forth between ButtonCode/AnalogCode + strings
  24. const char *ButtonCode_ButtonCodeToString( ButtonCode_t code, bool bXController );
  25. const char *AnalogCode_AnalogCodeToString( AnalogCode_t code );
  26. ButtonCode_t ButtonCode_StringToButtonCode( const char *pString, bool bXController );
  27. AnalogCode_t AnalogCode_StringToAnalogCode( const char *pString );
  28. ButtonCode_t ButtonCode_SKeyToButtonCode( int nPort, int keyCode );
  29. #endif // KEY_TRANSLATION_H