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.

63 lines
1.5 KiB

  1. //========= Copyright Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. //=============================================================================
  6. #ifndef KEYBINDINGHELPDIALOG_H
  7. #define KEYBINDINGHELPDIALOG_H
  8. #ifdef _WIN32
  9. #pragma once
  10. #endif
  11. #include "vgui_controls/Frame.h"
  12. #include "vgui/KeyCode.h"
  13. namespace vgui
  14. {
  15. class ListPanel;
  16. class CKeyBoardEditorDialog;
  17. //-----------------------------------------------------------------------------
  18. // Purpose: Dialog for use in editing keybindings
  19. //-----------------------------------------------------------------------------
  20. class CKeyBindingHelpDialog : public Frame
  21. {
  22. DECLARE_CLASS_SIMPLE( CKeyBindingHelpDialog, Frame );
  23. public:
  24. CKeyBindingHelpDialog( Panel *parent, Panel *panelToView, KeyBindingContextHandle_t handle, KeyCode code, int modifiers );
  25. ~CKeyBindingHelpDialog();
  26. virtual void OnCommand( char const *cmd );
  27. virtual void OnKeyCodeTyped(vgui::KeyCode code);
  28. // The key originally bound to help was pressed
  29. void HelpKeyPressed();
  30. private:
  31. virtual void OnTick();
  32. bool IsHelpKeyStillBeingHeld();
  33. void PopulateList();
  34. void GetMappingList( Panel *panel, CUtlVector< PanelKeyBindingMap * >& maps );
  35. void AnsiText( char const *token, char *out, size_t buflen );
  36. vgui::PHandle m_hPanel;
  37. KeyBindingContextHandle_t m_Handle;
  38. KeyCode m_KeyCode;
  39. int m_Modifiers;
  40. ListPanel *m_pList;
  41. double m_flShowTime;
  42. bool m_bPermanent;
  43. DHANDLE< CKeyBoardEditorDialog > m_hKeyBindingsEditor;
  44. };
  45. }
  46. #endif // KEYBINDINGHELPDIALOG_H