aboutsummaryrefslogtreecommitdiffstats
path: root/src/inputmanager.cpp
blob: 402cc420d4f8c9f887479c55781b1e0c2097dd43 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#include "inputmanager.hpp"

namespace yage
{

void InputManager::keyPressed(unsigned key)
{
	key_map_[key]=true;
}

void InputManager::keyReleased(unsigned key)
{
	key_map_[key]=false;
}

bool InputManager::isKeyPressed(unsigned key) const
{
	auto key_index=key_map_.find(key);
	if(key_index!=key_map_.end())
		return key_index->second;
	return false;
}

}