-
Notifications
You must be signed in to change notification settings - Fork 1
/
InputBinding.cpp
48 lines (42 loc) · 1.35 KB
/
InputBinding.cpp
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
43
44
45
46
47
48
/*----------------------------------------------
Ruben Young ([email protected])
Date : 2019/10
Description : Implementation for structures defined in InputBinding.h
----------------------------------------------*/
#include "InputBinding.h"
#include <vector>
#include <string>
namespace Input {
// Default Binding Constructor
Binding::Binding() :
keyCode(0),
keyState(KeyState::JustReleased)
{};
// Create Binding from keycode and keystate
Binding::Binding(const unsigned int pkeyCode, const KeyState pkeyState) :
keyCode(pkeyCode),
keyState(pkeyState)
{};
// Default Chord Constructor
Chord::Chord() :
name(L""),
chord(0)
{};
// Create Chord from Name, create binding from keycode and keystate and add it to Chord structure
Chord::Chord(const std::wstring& pName, const unsigned int pkeyCode, const KeyState pkeyState) :
name(pName)
{
chord.push_back(Binding(pkeyCode, pkeyState));
}
// Create Chord from Name and Binding&
Chord::Chord(const std::wstring& pName, const Binding& pBinding) :
name(pName)
{
chord.push_back(pBinding);
}
// Create Chord from Name and vector of Bindings
Chord::Chord(const std::wstring& pName, const std::vector<Binding>& plBinding) :
name(pName),
chord(plBinding)
{};
}