summaryrefslogtreecommitdiff
path: root/public/vgui/keyrepeat.h
diff options
context:
space:
mode:
authorFluorescentCIAAfricanAmerican <[email protected]>2020-04-22 12:56:21 -0400
committerFluorescentCIAAfricanAmerican <[email protected]>2020-04-22 12:56:21 -0400
commit3bf9df6b2785fa6d951086978a3e66f49427166a (patch)
tree2c0f1f0c63c4832882bc93814ebd2c2b1c6224e5 /public/vgui/keyrepeat.h
downloadarchived-source-engine-2018-hl2-src-master.tar.xz
archived-source-engine-2018-hl2-src-master.zip
Diffstat (limited to 'public/vgui/keyrepeat.h')
-rw-r--r--public/vgui/keyrepeat.h47
1 files changed, 47 insertions, 0 deletions
diff --git a/public/vgui/keyrepeat.h b/public/vgui/keyrepeat.h
new file mode 100644
index 0000000..874cc03
--- /dev/null
+++ b/public/vgui/keyrepeat.h
@@ -0,0 +1,47 @@
+//========= Copyright Valve Corporation, All rights reserved. ============//
+//
+// Purpose:
+//
+//=============================================================================
+
+#ifndef KEYREPEAT_H
+#define KEYREPEAT_H
+#ifdef _WIN32
+#pragma once
+#endif
+
+namespace vgui
+{
+
+enum KEYREPEAT_ALIASES
+{
+ KR_ALIAS_UP,
+ KR_ALIAS_DOWN,
+ KR_ALIAS_LEFT,
+ KR_ALIAS_RIGHT,
+
+ FM_NUM_KEYREPEAT_ALIASES,
+};
+
+class CKeyRepeatHandler
+{
+public:
+ CKeyRepeatHandler();
+
+ void Reset();
+ void KeyDown( vgui::KeyCode code );
+ void KeyUp( vgui::KeyCode code );
+ vgui::KeyCode KeyRepeated();
+ void SetKeyRepeatTime( vgui::KeyCode code, float flRepeat );
+
+private:
+ bool m_bAliasDown[MAX_JOYSTICKS][FM_NUM_KEYREPEAT_ALIASES];
+ float m_flRepeatTimes[FM_NUM_KEYREPEAT_ALIASES];
+ float m_flNextKeyRepeat[MAX_JOYSTICKS];
+ bool m_bHaveKeyDown;
+};
+
+
+} // namespace vgui
+
+#endif // KEYREPEAT_H