aboutsummaryrefslogtreecommitdiff
path: root/mp/src/public/tier2/keybindings.h
blob: 050219e6798b207bbd0f767deed9a8377e03eda6 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
//========= Copyright Valve Corporation, All rights reserved. ============//
//
// Purpose: 
//
// $NoKeywords: $
//
//===========================================================================//
	   
#ifndef KEYBINDINGS_H
#define KEYBINDINGS_H

#ifdef _WIN32
#pragma once
#endif

#include "tier1/utlstring.h"
#include "inputsystem/ButtonCode.h"

class CUtlBuffer;


class CKeyBindings
{
public:
	void SetBinding( ButtonCode_t code, const char *pBinding );
	void SetBinding( const char *pButtonName, const char *pBinding );

	void Unbind( ButtonCode_t code );
	void Unbind( const char *pButtonName );
	void UnbindAll();

	int GetBindingCount() const;
	void WriteBindings( CUtlBuffer &buf );
	const char *ButtonNameForBinding( const char *pBinding );
	const char *GetBindingForButton( ButtonCode_t code );

private:
	CUtlString m_KeyInfo[ BUTTON_CODE_LAST ];
};


#endif // KEYBINDINGS_H